Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Help with Warning: mysql_num_rows():


Phil77

Recommended Posts

Hi, i have tried to search the site and google for help with this but havent found an answer. I'm getting this error message Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home2/milliesd/public_html/includes/functions/database.php on line 103

it doesnt seem to affect anything but if you could help me fix it please?

 

below is lines 102-104 of database.php

function tep_db_result($result, $row, $field = '') {

return mysql_result($result, $row, $field);

}

 

Thanks

Link to comment
Share on other sites

The fault is with the page caling this code.

 

What contributions have you installed recently.

 

Check, check and re-check you have run each step in the installation instructions. (even those you did not understand what they were talking about, missing any out is not an option.)

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

function tep_db_result($result, $row, $field = '') {

 

If the results are coming ok then apply @

 

 

Satish

Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site.

 

Check My About US For who am I and what My company does.

Link to comment
Share on other sites

Just a little too cryptic for me to understand.

 

G

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

thanks for your replys, i've started to check through the mods I did and havent seen anything so far. Satish, I dont understand what you mean i'm a total noob.

 

what satish means is to put an '@' in front of the function call, so the code looks like this:

@tep_db_result($result, $row, $field = '')

 

this will make php not report an error with the function call. so this does not fix the problem, it merely masks it so you won't see the error message any more.

 

the problem is caused by not providing the correct sql resource identifier to the mysql_num_rows() function. this resource is the value returned from the mysql_connect() call and should be used by all the tep_db_xxx() functions automatically.

 

the error can be caused by a few different things, but you'll have to track it down by starting at the page you're loading. is it index.php or checkout_shipping.php or something else? start there and look at the changes that you've made to that page, as well as any possible changes to the includes/functions/database.php code. somewhere along the line, you've caused the mysql_num_rows() function to be called with a value that won't work for it.

 

i hope that makes it a little clearer.

Link to comment
Share on other sites

i've been searching for ages now checking modded files against original ones etc. the database files are the same and the only differences between the others are for the mods that are working, eg lightbox 2 and featured products. the only other changes are on the stylesheet. The problem occurs when i click on the actual product. So .index -fine, index.php?cPath=30 -fine, product_info.php?cPath=30&products_id=75 -warning message. This happens with any product. So i've been checking the product_info.php is that right?

Link to comment
Share on other sites

i've been searching for ages now checking modded files against original ones etc. the database files are the same and the only differences between the others are for the mods that are working, eg lightbox 2 and featured products. the only other changes are on the stylesheet. The problem occurs when i click on the actual product. So .index -fine, index.php?cPath=30 -fine, product_info.php?cPath=30&products_id=75 -warning message. This happens with any product. So i've been checking the product_info.php is that right?

 

yes, product_info.php does seem to be the place to start. you'll have to look at the files that it includes (application_top, etc.), and then the files that those files include.

 

what would be useful is a way to do error logging, trapping the error when it happens and get the php traceback information. the tracback will tell you how the function came to be called -- as in product_info.php called application_top.php, which then called database.php, with line numbers so you can see how it all happened. php can do this and you might be able to find a contribution that will set it up.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...