Everybody look at me, there's something wrong with that?
mysql_query ("DROP PROCEDURE IF EXISTS Change", $con) or Die ("error:". Mysql_error ());
Recently in learning about stored procedures, add and delete stored procedures in PHP.
The error message is:
Error: You have a error in your SQL syntax; Check the manual that corresponds to your MySQL server version for the right syntax to use the "change" at line 1
Do not understand, even more simple, become
mysql_query ("DROP PROCEDURE IF EXISTS change") or Die ("error:". Mysql_error ());
Or not ....
However, if I put the following sentence or die ("error:". Mysql_error ()) deleted, the program does not error ...
Why is that?
------Solution--------------------
Change is a MySQL reserved word that needs to be escaped
mysql_query ("DROP PROCEDURE IF EXISTS ' Change '", $con) or Die ("error:". Mysql_error ());