note 37092 added to function.mysql-query
| From: | murat at robcol dot k12 dot tr | Date: | Mon, 03 Nov 2003 00:22:50 +0000 |
| Subject: | note 37092 added to function.mysql-query | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-59668@lists.php.net to get a copy of this message | ||
Notice that you cannot return the result directly if you are calling mysql_query() from a function.
function sqlgo($inp) {
return mysql_query($inp)
or die ("Could not successfully run query ($inp) from DB: " . mysql_error());
}
will fail whereas
function sqlgo($inp) {
$res = mysql_query($inp)
or die ("Could not successfully run query ($inp) from DB: " . mysql_error());
return $res;
}
will work..
----
Manual Page -- http://www.php.net/manual/en/function.mysql-query.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+37092
Delete -- http://master.php.net/manage/user-notes.php?action=delete+37092&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+37092&report=yes
Search -- http://master.php.net/manage/user-notes.php