473,386 Members | 1,785 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,386 software developers and data experts.

mysql_num_rows(): supplied argument is not a valid MySQL

matheussousuke
249 100+
I'm having the following trouble:

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/mghosped/public_html/anuncieaki/lib/func_common.php on line 149


This is the line 149

Expand|Select|Wrap|Line Numbers
  1. for ($i=1; $i<mysql_num_rows($result); $i++  )

The same script works fine in another server, but not in that one.
Nov 18 '09 #1
11 3677
Dormilich
8,658 Expert Mod 8TB
check if mysql_query() return false.
Nov 18 '09 #2
matheussousuke
249 100+
@Dormilich
Where do I check that?

Ps: I've no access to php.ini.
Nov 18 '09 #3
Dormilich
8,658 Expert Mod 8TB
@matheussousuke
Expand|Select|Wrap|Line Numbers
  1. $result = mysql_query($sql) or die("Oops, I did it again: " . mysql_error());
Nov 18 '09 #4
matheussousuke
249 100+
@Dormilich


I guess I got it, I've do following on the lines 234 and 136:

Expand|Select|Wrap|Line Numbers
  1.  $result = mysql_query($query, $myDB);

Is this that I need to change?
Nov 18 '09 #5
Dormilich
8,658 Expert Mod 8TB
yepp
___________________
Nov 18 '09 #6
matheussousuke
249 100+
@matheussousuke

So it will be like this?

Expand|Select|Wrap|Line Numbers
  1. $result = mysql_query($query, $myDB);or die("Oops, I did it again: " . mysql_error());
Nov 18 '09 #7
Dormilich
8,658 Expert Mod 8TB
without the first semicolon.
Nov 18 '09 #8
matheussousuke
249 100+
@Dormilich

Now I got the following error:

Oops, I did it again: Table 'mghosped_akidb.std_categories' doesn't exist
Nov 18 '09 #9
Dormilich
8,658 Expert Mod 8TB
if this table does not exist, you cannot query it…
Nov 18 '09 #10
matheussousuke
249 100+
@matheussousuke
Oops, I did a terrible mistake, wait a minute.
Nov 18 '09 #11
matheussousuke
249 100+
Ok, I did it. Thanks.
Nov 18 '09 #12

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Arjan | last post by:
I've got the following error: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/wbdfdart/public_html/wbdfforum/verwijder.php on line 13 verwijder.php ...
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 =...
4
by: Fish44 | last post by:
Ive got the following code which works great on my localserver, but when i upload it to my service provider i get an error "Warning: mysql_num_rows(): supplied argument is not a valid MySQL...
7
by: Dejan | last post by:
Hi Sorry for my terreble english. On my local (win) comp i have apache+mysql+php 4.05 I'm counting rows using mysql_num_rows function, and everything works fine. When i upload php file on...
3
by: petemaxi | last post by:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\Program Files\xampp\htdocs\tockholes\includes\menu.inc.php on line 9 <div class="left"> <div class="menu">...
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...
6
by: Tinker | last post by:
hi i am having a problem i can figure out can some one please tell me how to fix this PHP Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /hermes/ i took out the...
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...
4
by: seigaku | last post by:
Hi everyone, I've recently begun learning PHP and it looks like I took on too much so soon. I'm attempting to fix a php script that detects whether or not a person is Eligible to join a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.