note 19560 added to function.mysql-num-rows
| From: | pvt at webmobiles dot com | Date: | Mon, 04 Mar 2002 01:39:19 +0000 |
| Subject: | note 19560 added to function.mysql-num-rows | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-27303@lists.php.net to get a copy of this message | ||
I have found that using the following OCCASSIONALLY produced an error specifying that something was
not a valid MySQL resource.
$sql = "Select sid from table1;
$result = @mysql_query($sql);
$num = mysql_num_rows($result);
All I really wanted was a count of rows.
I added this above that code and the problem was solved.
mysql_select_db("dbname");
I had the db selection elsewhere in my code so I guess that's why I occassionally experienced
the problem.
I hope this helps clear things up for someone.
-PVT
--
http://www.php.net/manual/en/function.mysql-num-rows.php
http://master.php.net/manage/user-notes.php?action=edit+19560
http://master.php.net/manage/user-notes.php?action=delete+19560
http://master.php.net/manage/user-notes.php?action=reject+19560