PHP Classes

mysql_num_rows

Recommend this page to a friend!

      PHP MySQL to MySQLi  >  PHP MySQL to MySQLi package blog  >  Do tomorrow what does...  >  All threads  >  mysql_num_rows  >  (Un) Subscribe thread alerts  
Subject:mysql_num_rows
Summary:mysql_num_rows returns an error
Messages:4
Author:Omar
Date:2015-09-19 01:19:43
 

  1. mysql_num_rows   Reply   Report abuse  
Picture of Omar Omar - 2015-09-19 01:19:43
Any script which contains the functions mysql_num_rows returns the following error --

PHP Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, null given in /usr/home/includes/mysql2i.class.php on line 377

  2. Re: mysql_num_rows   Reply   Report abuse  
Picture of Dave Smith Dave Smith - 2015-09-19 03:45:21 - In reply to message 1 from Omar
Looks like the problem is in the mysqli.func.php file, on line 223.

Change

return mysql2i::mysql_num_rows($r);

To

return mysql2i::mysql_num_rows($result);

Thanks for the catch, let me know if you are still have problems.

Dave

  3. mysql_real_escape_string   Reply   Report abuse  
Picture of Omar Omar - 2015-09-23 20:55:52 - In reply to message 2 from Dave Smith
When mysql_real_escape_string is used, I get the following error --

Fatal error: Call to undefined method mysql2i::mysqli_real_escape_string() in /usr/home/includes/mysql2i.func.php on line 247

  4. Re: mysql_num_rows   Reply   Report abuse  
Picture of Dave Smith Dave Smith - 2015-09-23 21:20:34 - In reply to message 3 from Omar
Change line 247 in mysql2i.func.php file from

return mysql2i::mysqli_real_escape_string($escapestr,$link);

to

return mysql2i::mysql_real_escape_string($escapestr,$link);


I am not sure how that typo got through my local testing, but somehow it did. Thanks for the catch.

Dave