|
Posted by bobzimuta on 03/23/06 22:04
Extract the query into a string (i.e. $query = "..."), and replace
mysql_query() with
the following:
if( !mysql_query( $query, $connection ) )
{
exit( mysql_error( $connection ) . "<br>Query: <br><pre>" . $query .
"</pre>" );
}
You can wrap all your query calls in a function, as it enables basic
debugging any time a query might fail
function my_query( $query, $connection, $DEBUG = 0 )
{
$query_worked = mysql_query....
if( !$query_worked && $DEBUG )
{
// do the exit and output here, or just output and return
$query_worked
}
else
{
return $query_worked;
}
}
}
Navigation:
[Reply to this message]
|