Jump to content

Undefined function mysql_num_rows?


tibberous

Recommended Posts

I'm getting an error that mysql_num_rows and mysql_result are undefined. Whats really weird is that mysql_connect and mysql_select_db are working.

 

Any idea what would cause it? I'm running it on windows, set my extension directory and uncommented out extension=php_mysql.dll in the php.ini.

 

Apache 2.0.63

PHP 5.2

Link to comment
Share on other sites

I don't know man. If you can connect then php is running. I usually write queries like this so it's easier to trouble shoot.

 

mysql_select_db($database, $connection);

$query = "SELECT x FROM y ";

$result = mysql_query($query, $connection) or die(mysql_error());

$num_row = mysql_num_rows($result);

 

Link to comment
Share on other sites

You have to enable the mysql extension in the php.ini file.

 

Open that file and fine extensions then find the php_mysql (I think it is) and remove the ; from the beginning of that line, restart apache and it should work.

 

EDIT:

Noticed that he did uncomment, but did you restart apache :)

Link to comment
Share on other sites

  • 13 years later...

 


Fatal error: Uncaught Error: Call to undefined function mysql_num_rows() in C:\xampp\htdocs\my_first_php\upload_profile_pic\signup.php:16 Stack trace: #0 {main} thrown in C:\xampp\htdocs\my_first_php\upload_profile_pic\signup.php on line 16

Plz, I'm also getting a similar error in my PHP code what's the solution dude?

 

 

Edited by bashmunir
Link to comment
Share on other sites

  • Barand locked this topic
Guest
This topic is now closed to further replies.
×
×
  • 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.