note 56919 deleted from function.mysql-query by mazzanet
| From: | mazzanet@php.net | Date: | Sun, 02 Oct 2005 13:14:27 +0000 |
| Subject: | note 56919 deleted from function.mysql-query by mazzanet | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-96170@lists.php.net to get a copy of this message | ||
Note Submitter: merlin at nodns dot com
----
Here's a simple function to use when writing your code, to echo mysql errors until you are sure
the queries are correct:
<?php
function mysql_query_show_error($QUERY) {
$RESULT = mysql_query($QUERY)
or die("The following query failed:<br>\n".
"$QUERY<br>\n".
"MySQL error message: <br>\n".
mysql_errno().": ".mysql_error()."<br>\n");
return $RESULT;
}
?>