note 56919 added to function.mysql-query
| From: | merlin at nodns dot com | Date: | Mon, 19 Sep 2005 14:49:45 +0000 |
| Subject: | note 56919 added to function.mysql-query | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-95412@lists.php.net to get a copy of this message | ||
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;
}
?>
----
Manual Page -- http://www.php.net/manual/en/function.mysql-query.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+56919
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+56919&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+56919&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+56919&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+56919&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+56919&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+56919&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+56919&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+56919&report=yes
Search -- http://master.php.net/manage/user-notes.php