Jump to content

why won't my SQL work?


mickwaffle

Recommended Posts

O ye.. sorry.. i actually had that error line in.. just forgot to put it here.. anyway error is :

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'read='0' AND view='1'' at line 1
Link to comment
https://forums.phpfreaks.com/topic/167281-why-wont-my-sql-work/#findComment-882046
Share on other sites

READ is a reserved word in MySQL:

http://dev.mysql.com/doc/refman/5.1/en/reserved-words.html

 

I highly recommend changing the name of that column...but if you are beyond the point of no return, you can use backticks:

mysql_query("SELECT * FROM advert_notices WHERE owner_uuid='$owner_uuid' AND `read`='0' AND view='1'") or die mysql_error());

Link to comment
https://forums.phpfreaks.com/topic/167281-why-wont-my-sql-work/#findComment-882052
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.