Jump to content

Recommended Posts

Hello guys,

 

in my PLESK error_log i have always the same error:

 

PHP Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /var/www/vhosts/mysite.com/httpdocs/inc/xtc_db_num_rows.inc.php on line 24

 

What mean this? Im searching days for the solution, but i dont find the answer. I dont now many about PHP an Mysql

 

Im using a XTCommerce shop on apache with mysql 5.0 by 1and1.

 

I hope someone can give me help!

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/180141-problem-with-db_num_rows/
Share on other sites

Hi,

 

sorry, i forgot to post it:

 

 

  function xtc_db_num_rows($db_query,$cq=false) {

      if (DB_CACHE=='true' && $cq) {

        if (!count($db_query)) return false;

    return count($db_query);

      } else {

 

        if (!is_array($db_query)) return mysql_num_rows($db_query);  = This is the line 24.

 

      }

 

That is all the script

Hello Smerny,

 

the problem is, that i even dont know wich function is calling this script. I only know, that is called almost evry time if someone visit a page of the shop.

Maybe you can tell me how to find it out?

 

I dont know if it is helpful, but a little bit further down i have this:

   

}

      /*

    if (!is_array($db_query)) return mysql_num_rows($db_query);

    if (!count($db_query)) return false;

    return count($db_query);

    */

  }

 

Thank you

 

 

i'm just wondering what is being passed in the dp_query parameter

 

 

try changing

 

      } else {

         if (!is_array($db_query)) return mysql_num_rows($db_query);  

      }

 

to

 

      } else {

         //if (!is_array($db_query)) return mysql_num_rows($db_query); 
        echo "DB_QUERY = ".$db_query;
      }

and see what it says

Hello,

 

i have try it, but when i was calling the shop, firefox give me the error:

 

Error in the codificacion of the content

 

The page wich you are trying to visualize can not be show caus you are using a format of compression not valid o admit

 

Maybe i wrote something wrong, here the script after edit:

 

  function xtc_db_num_rows($db_query,$cq=false) {

      if (DB_CACHE=='true' && $cq) {

        if (!count($db_query)) return false;

    return count($db_query);

      } else {

 

        //if (!is_array($db_query)) return mysql_num_rows($db_query);

        echo "DB_QUERY = ".$db_query;

      }

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.