Faqts : Computers : Programming : Languages : PHP : Database Backed Sites : MySQL

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

4 of 10 people (40%) answered Yes
Recently 4 of 10 people (40%) answered Yes

Entry

DB Error unknown error when inserting row into MySQL; Echoed SQL worked in console

Mar 15th, 2004 10:42
Matt Chatterley, Scott Kraatz,


You can obtain more information on errors such as this by using a
construct akin to:
$sSQL = "SQL Statement";
mysql_query($sSQL, $database_connection) or 
die("Failed to execute: ".$sSQL."<br>".mysql_error($database_connection));
It may be that you've failed to enclose a string argument in ''s, or
something similar - by using the above you'll get a good amount of debug
output (i.e. the final statement sent to the database), plus the error
returned.