Re: mysql_num_rows
| From: | J. Connolly | Date: | Tue, 08 Mar 2005 13:37:51 +0000 |
| Subject: | Re: mysql_num_rows | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-38814@lists.php.net to get a copy of this message | ||
Use the mysql_error() function which may give you more answers. In addition you can use something like
$num = mysql_num_rows($test);
echo $num;
If it returns 0 you have no entries, if nothing happens then you have problem with your query or connection. If you get a number then there is something else wrong. This is a test I haa to use to sort out some code. It is best if you use mysql_error() whenever possible during testing so that you can know exactly what goes wrong where. But I am a noob. There are probaly others with better answers.
Tsegaye Woldegebriel wrote:
Dear Sir or Madame, I found the following error, Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/xxx/public_html/sitename/dynamicfile.php on line 61 What is the reason? I want anyone who knows to answer to reply me. Thank you in advance for sharing your precious time.