you must first query sql statement and then count row.
|
|
you are not running the sql statement by using
mysqli_queryyou must first query sql statement and then count row. |
See the example.
<?php
$conn = mysqli_connect("127.0.0.1", "my_user", "my_password", "my_db");
/*mysqli connection*/
$check = mysqli_real_escape_string($link, $_REQUEST['email']);
$sql = "SELECT * FROM users WHERE email = '$check'";
$res = mysqli_query($conn,$sql);
if (mysqli_num_rows($res ) == 0){
echo 'Number of Row 0';
} else {
echo 'Row available';
}
?>| mysqli num rows |
Type: | Develop |
Category: | Web Tutorial |
Sub Category: | Mysqli Select Tutorial |
Uploaded by: | Admin |