I know this question is already asked so many times. i am a newbie and i dont know why mysqli_num_row is not working.Even i tried procedural method of calling and OO method. still the count is 0. help me out, thanks in advance. excuses if any wrong in question.
EDITED: I made a mistake on posting this question , Email is not encrypted. so i am removing the encryption on email. but the script is still not working.
<html>
<body>
<h1 user registration </h1>
<form action="" method="POST">
Email: <input name="ema" type="text" > <br>
Password: <input name="pwd" type="password" required> <br>
<input value="submit" type="submit">
</form>
<?php
require_once("connect.php");
@$email = $_POST['ema'];
@$password = hash('sha512' , $_POST['pwd']);
// SELECTING THE USER
$sql = " SELECT * FROM `users` WHERE ema = '$email' and pwd = '$password' ";
$result = mysqli_query($con, $sql);
if ($result)
{
echo "code is working" ;
$count = $result->num_rows;
echo $count;
}
?>
</body>
</html>