I’dont understand this:
I will update a mysql database.
mysql_query("UPDATE image Set title = '".$ed1."', desc = '".$ed2."', cat = '".$ed3."', privacy = '".$ed4."' WHERE id = '".$id."'");
But it shows:
ERROR 1064
and:
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 desc = […]
EDIT:
Thanks for reply. I’ve renamed the name! Now it works 😉
DESC is a reserved word in SQL. You’ll need to quote it if you want to use it:
You should try to avoid using reserved words for field names if you can; there’s a list here:
http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html
You should also look at migrating from
mysql_*functions, as they’re being deprecated. You should look at using PDO or mysqli instead – they both help you write much more secure SQL.