Jump to content

Archived

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

robtecc

Problem with db_num_rows

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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

 

 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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;

      }

Share this post


Link to post
Share on other sites

×
×
  • 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.