I\'m pretty new to php.. and this is probably a stupid mistake... but I have no idea what is going on. I\'m trying to create a table in my database using php. I want to name
Add this after your SQL querys - (It really helps and speeds up error correcting time)
or die("A MySQL error has occurred.
Error: (" . mysql_errno() . ") " . mysql_error());
echos this in your instance:
A MySQL error has occurred.
Error: (1064) 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 '' . ' ID INT NOT NULL AUTO_INCREMENT PRIMARY KEY, ' . ' please VARCH' at line 1
This then indicates to me that the error regards " & '.
After changing the code to contain single quotes and executing it, there is now no echo.
Error: (" . mysql_errno() . ") " . mysql_error());
?>
Note: Please refer to the MySQLi extension when using SQL embedded in PHP. mysql_* is in a deprecation process.
Hope this helps.