473,379 Members | 1,255 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

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 4222
$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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: jaysonsch | last post by:
Hello! I am having some problems with a database query that I am trying to do. I am trying to develop a way to search a database for an entry and then edit the existing values. Upon submit, the...
3
by: cover | last post by:
I have a table with 50 fields that receive input depending on whether that input came in from a 'shaker' form or a 'conveyor' form. Input from the 'conveyor' form might populate 25 fields while...
11
by: ZafT | last post by:
Hi all - thanks in advance for any help. I am trying to write a simple update script. In fact, I am re-using code that I've used before (successfully) but I can't figure out why it is not...
1
by: darko | last post by:
I'm pretty good at php and mysql, it's been sometime now that i was trying to find a way to output result, more then 1 at a time, so i came up with this function function screenshots() { ...
5
by: cover | last post by:
I'm trying to populate the pulldown menus of a single input form through queries from a single table. The three columns are 'name', 'type', and 'status'. The name table runs to approx row 23, the...
4
by: atyndall | last post by:
OK, this is the relevant portion script: <?php $username = '__'; // MySQL Database Username. $password = '__'; // MySQL Database Password. $server = '__'; // MySQL Database server (most...
2
by: DavidPr | last post by:
I have a Bible database and I need help writing the query a little bit of styling. I want to display all the books and chapters (which will be linked to another page -passage.php) that will...
4
by: raaman rai | last post by:
Pls see the code below, where i wanted to select all the records from my table where the submdate (submission date) is greater or equal to today's date. Whereas i have two or three records in my...
3
by: monion | last post by:
One more question. How can I get query values assign them to a variable, but not show them? for example size, $f4 in the following: How can I pass that value $f4 to the form handle page to submit...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.