473,396 Members | 2,013 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,396 software developers and data experts.

Problem with mysql_num_rows() on HP and MySql 3.x.x

Has anyone ran into problems where mysql_num_rows() return 0 when I
know the result set contains a certain number of rows? My code looks
something like this:

MYSQL_RES *result;
int numRows = -1;
mysql_query(conn, "show databases");
result = mysql_store_result (conn);
numRows = mysql_num_rows (result);

On an HP machine running MySql 3.23.x, mysql_num_rows() always returns
0. It works fine on a sparc and alpha. Looks like
mysql_store_result() messed up the connection object, and num_rows is
one of the elements that got messed up. I can do mysql_fetch_row()
just fine, but mysql_num_rows() would still return 0. Anyone have
this same problem?
Jul 20 '05 #1
1 1805
Looks like mysql_store_result() doesn't mess up anything. However,
the result set that it returns has num_rows set to 0. I am wondering
whether this has anything to do with the fact that num_rows is a
ulonglong, which is 64-bits on an HP system, but 32-bits on Sparc and
Alpha.
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: David Nikel | last post by:
I am attempting to create a login script. The following snippet of code: $query = "select * from auth where username='$username' and password=password('$password')"; $result =...
1
by: josys64 | last post by:
i have a strange problem : MySQL 4.0.21 innodb and php 4.3.9-1 all tables are in innodb type. For a simple select statement sometimes i get result and sometimes nothing (i.e mysql_num_rows()>0...
2
by: ameshkin | last post by:
I'm having all kinds of visual problems using dreamweaver's built in query builder. I have 4 different categories. Right. I want to show ten records from each category of items in a mysql...
2
by: styliek | last post by:
I know this might not be the right place for a sql problem but as im writhing in php I thought someone might be able to help. Im creating a registering page, where the scripts should first check if...
4
by: Ryanlawrence1 | last post by:
Heya, I get these 2 errors: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/themepar/public_html/changepass.php on line 20 You have not entered all the...
10
by: paul814 | last post by:
I am having a bit of a problem with some code....can someone give me some suggestions? Parse error: syntax error, unexpected '{' in C:\xampp\htdocs\production \date2.php on line 28 line 28 is...
1
by: hesameagle | last post by:
Hi I want to use ajax to connect to database and echo some data in my page, I wrote these two codes that can handle my need: index.php ----------------------------------------- <?php ...
4
by: fisherd | last post by:
When i run this code, i keep getting this message; Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\wamp\www\checklogin.php on line 26 i use this code to...
2
by: jeddiki | last post by:
Hi I have two tables and I am trying to step through them using mysql arrays. I think that maybe I have not understood the foreach loop properly. I have two of them, it looks logical to me...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.