Error code 1054 in sql unknown colum

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
loadafile
Forum Newbie
Posts: 7
Joined: Sun Oct 23, 2011 10:27 pm

Error code 1054 in sql unknown colum

Post by loadafile »

Hi guys I hope you can help I have been working alot on my site and I seem to have hit a road block.

The script was purchased with alot of bugs that I managed to fix on my own. The only issue I have now is when a user wants to delete a folder.

http://www.loadafile.com

If you take a look you will see if you upload a file it will delete perfectly.

but if you go to the manage folders category, then add folder...then try to delete the folder you made you get a database error.


This is what my log shows

Code: Select all

==============================================================================
|| Request URI: /index.php/folders/delete?folder=1
|| Date: Tue Oct 25 07:18:40 2011
|| IP Address: xxxxxxxxx
|| Error: 1054 Unknown column 'folder_id' in 'where clause'
|| 
|| DELETE FROM files WHERE folder_id=1
|| array (
  0 => 
  array (
    'file' => '/home/content/54/6252454/html/library/database/mysql.php',
    'line' => 153,
    'function' => 'fatalError',
    'class' => 'Core_Database',
    'type' => '->',
    'args' => 
    array (
      0 => 1054,
      1 => 'Unknown column \'folder_id\' in \'where clause\'',
      2 => 'DELETE FROM files WHERE folder_id=1',
    ),
  ),
  1 => 
  array (
    'file' => '/home/content/54/6252454/html/controllers/folders.php',
    'line' => 124,
    'function' => 'query',
    'class' => 'Core_Database_mysql',
    'type' => '->',
    'args' => 
    array (
      0 => 'DELETE FROM %sfiles WHERE folder_id=1',
    ),
  ),
  2 => 
  array (
    'file' => '/home/content/54/6252454/html/controllers/folders.php',
    'line' => 56,
    'function' => '_delete',
    'class' => 'controller_folders',
    'type' => '->',
    'args' => 
    array (
    ),
  ),
  3 => 
  array (
    'file' => '/home/content/54/6252454/html/library/controller.php',
    'line' => 98,
    'function' => 'dispatch',
    'class' => 'controller_folders',
    'type' => '->',
  ),
  4 => 
  array (
    'file' => '/home/content/54/6252454/html/index.php',
    'line' => 27,
    'function' => 'initialize',
    'class' => 'Controller',
    'type' => '::',
    'args' => 
    array (
    ),
  ),
)
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: Error code 1054 in sql unknown colum

Post by social_experiment »

Can you paste the query that creates the error message?
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Post Reply