note 26484 added to function.mysql-query
| From: | tom at tom420 dot com | Date: | Fri, 01 Nov 2002 06:30:00 +0000 |
| Subject: | note 26484 added to function.mysql-query | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-38856@lists.php.net to get a copy of this message | ||
The following fails:
function sqlquery ($query)
{
return mysql_query ($query);
}
If I do:
$results = sqlquery ("SELECT bla");
mysql_num_rows($results);
it says thats $results is not a ressource handler.
The following works fine though:
function sqlquery ($query)
{
$rs = mysql_query ($query);
return $rs;
}
Looks like that there is some operation done when storing the ressource handler into a variable,
which can't be performed when you do something with the results instead of storing it.
(Of course sqlquery() does nothing usefull here, I needed to do some other task in it in my script
which I did not include for simplicity)
--
http://www.php.net/manual/en/function.mysql-query.php
http://master.php.net/manage/user-notes.php?action=edit+26484
http://master.php.net/manage/user-notes.php?action=delete+26484
http://master.php.net/manage/user-notes.php?action=reject+26484