1

Possible Duplicate:
PHP: Warning: sort() expects parameter 1 to be array, resource given

I'm getting this error on this line:

mysql_query('SELECT * FROM keys WHERE left > 0');

Community
  • 1
  • 1
user1119096
  • 113
  • 1
  • 9
  • Can you edit this to remove the automated message *and* provide all the details we need to let us help you... – gbn Jan 02 '12 at 12:53
  • This is like showing nothing! You need to add more code, error you are getting and preferably structure of that table. – Eugene Jan 02 '12 at 12:54
  • This isn't a line you get this error, this message is from one of the lines next to this one. – Juicy Scripter Jan 02 '12 at 12:55

1 Answers1

10

Both fields keys and left are mysql reserved word so that you have to use backticks like this

mysql_query('SELECT * FROM `keys` WHERE `left` > 0');

Better to write it with the trigger_error and mysql_error. this will produce the actual mysql error if any

mysql_query('SELECT * FROM `keys` WHERE `left` > 0') or trigger_error(mysql_error());
Shakti Singh
  • 81,083
  • 20
  • 131
  • 150