469,934 Members | 2,483 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,934 developers. It's quick & easy.

mysql_Numrows($query) gives a warning!

Hello,

I setting up my mysql-server and php on IIS6 and it works almost fine.
But I got the next error:
Warning: mysql_numrows(): supplied argument is not a valid MySQL result
resource in file.php on line 46.
But I'am sure that the code is good, because I have use the code very much.
Create a connection is working, mysql_query is working but
mysql_Numrows($query) is not working:
$query = mysql_query("SELECT * FROM users");
if (mysql_Numrows($query)>0)
{
code!!!
}

I have seen this error before, but I can't remember the solution anymore.
I think(I now it almost sure) that it has to do with the installation of PHP
or MYSQL.
PHP-version 4.3.7(mysql is built-in)
MYSQL 4.0.20d

I hope that somebody can help me to fix this problem.
So I can go further with my website!

Willem
Jul 20 '05 #1
2 4077
$query = mysql_query("SELECT * FROM users") or die(mysql_error());

Before calling the mysql_num_rows() function, make sure ur sql query has be
executed correctly.
if (mysql_num_rows($query)>0)
{
code!!!
}
ccton

--
www.vicdir.com
"Willem Berendsen" <wi****@schoppensnieder.nl> дʼ
news:cc**********@reader10.wxs.nl... Hello,

I setting up my mysql-server and php on IIS6 and it works almost fine.
But I got the next error:
Warning: mysql_numrows(): supplied argument is not a valid MySQL result
resource in file.php on line 46.
But I'am sure that the code is good, because I have use the code very much. Create a connection is working, mysql_query is working but
mysql_Numrows($query) is not working:
$query = mysql_query("SELECT * FROM users");
if (mysql_Numrows($query)>0)
{
code!!!
}

I have seen this error before, but I can't remember the solution anymore.
I think(I now it almost sure) that it has to do with the installation of PHP or MYSQL.
PHP-version 4.3.7(mysql is built-in)
MYSQL 4.0.20d

I hope that somebody can help me to fix this problem.
So I can go further with my website!

Willem

Jul 20 '05 #2
Thanks!
I forgot to select the right database!
Now its working fine!

Willem
"CryingClinton" <Cr***********@hotmail.com> schreef in bericht
news:cc***********@mail.cn99.com...
$query = mysql_query("SELECT * FROM users") or die(mysql_error());

Before calling the mysql_num_rows() function, make sure ur sql query has be executed correctly.
if (mysql_num_rows($query)>0)
{
code!!!
}


ccton

--
www.vicdir.com
"Willem Berendsen" <wi****@schoppensnieder.nl> дʼ
news:cc**********@reader10.wxs.nl...
Hello,

I setting up my mysql-server and php on IIS6 and it works almost fine.
But I got the next error:
Warning: mysql_numrows(): supplied argument is not a valid MySQL result
resource in file.php on line 46.
But I'am sure that the code is good, because I have use the code very

much.
Create a connection is working, mysql_query is working but
mysql_Numrows($query) is not working:
$query = mysql_query("SELECT * FROM users");
if (mysql_Numrows($query)>0)
{
code!!!
}

I have seen this error before, but I can't remember the solution anymore. I think(I now it almost sure) that it has to do with the installation of

PHP
or MYSQL.
PHP-version 4.3.7(mysql is built-in)
MYSQL 4.0.20d

I hope that somebody can help me to fix this problem.
So I can go further with my website!

Willem


Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by jaysonsch | last post: by
3 posts views Thread by cover | last post: by
11 posts views Thread by ZafT | last post: by
1 post views Thread by darko | last post: by
5 posts views Thread by cover | last post: by
2 posts views Thread by DavidPr | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.