mysql - php mysql_num_rows() function not working -
this php code print number of rows in database.actually there 3 rows in database matching query.but "echo $num" in code not printing please help.this code
<?php include('db.php'); $name=$_post['name']; $passwd=$_post['password']; $qry="select * user name='$name' , password='$passwd'" ; $result=mysqli_query($con,$qry) or die("error attempting query"); $num = mysql_num_rows($result); echo $num; ?>
you should use mysqli_num_rows($result);
instead of mysql_num_rows($result);
.
Comments
Post a Comment