5 replies
by blaine moore
Could be a few reasons. Badly formed SQL statement, referring to an invalid table or field, not inserting a value into every field (depending upon how your table is set up and how you have structured your SQL statement), overwriting a variable withyour SQL statement before actually using it, a typo in your code to insert the record...
Or it could be a network problem, such as the server or the client using a different level of encryption.
If you can't troubleshoot it then let me know, Ican try to think of more reasons.
by jeng
In addition to what the previous poster mentioned, you might also check the privileges for the user/db in the mysql database. Make sure that the user (and/or db) you are using has Insert_priv = 'Y'.
Also, if you are inserting text with quotes "'", don't forget to escape them in PHP with the addslashes() function.
To aid in debugging, if you have access to the MySQL server, you can restart it with the logging option enabled and look at the SQL statement. Or, you can output the error numberand message using the PHP mysql_errno() and mysql_error() function, respectively. Good luck.
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending