When I execute the following code, I gets this error:
Warning: mysql_num_rows() expects parameter 1 to be resource, object given in C:\wamp\www\my\myWork.php on line 53
Whats the wrong with this code?
<?php
if(isset($_POST['login']))
{
    $servername = "localhost";
    $username = "root";
    $password = "";
    $dbname = "Begin";
    $uName = $_POST["txtUsername"];
    $uPwd = $_POST["txtPwd"];
    echo "Your Username is: ".$uName."<br>";
    echo "Your password is: ".$uPwd."<br>";
    $conn = mysqli_connect($servername, $username, $password, $dbname);
    if(!$conn)
        die("Connection faild: " . mysqli_connect_error());
    $sql = "SELECT firstname from myguests WHERE firstname = '$uName'";
    $result = $conn->query($sql);
    if(mysql_num_rows($result) > 0)
        {
            echo "You have a login";
            $_SESSION['uname'] = $uName;
        }
    else
        echo "You don't have a login";
}
?>
 
     
    