-4

I have small errors when I add date to my database.

Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\wamp\www\chemmad\register.php on line 17.

But it works fine in my web server, but it is not working from local host.

Joe Doyle
  • 6,363
  • 3
  • 42
  • 45
Najm
  • 1

1 Answers1

0

mysql_num_rows is deprecated and you should not use it.

The correct way to count the number of rows in php is:

$db = new PDO( ... db connection details ...);
$q = $db->query('SELECT a, b, c FROM tbl WHERE oele = 2 GROUP BY boele');
$rows = $q->num_rows;

print $rows;
Abhi Beckert
  • 32,787
  • 12
  • 83
  • 110