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

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -