i am trying to create a php login script but i am having this error Warning: mysql_num_rows() expects parameter 1 to be resource, object given in C:\wamp\www\examSystem\login.php on line 57
PHP LOGIN SCRIPT
8
i am trying to create a php login script but i am having this error
Warning: mysql_num_rows() expects parameter 1 to be resource, object given in C:\wamp\www\examSystem\login.php on line 57
THIS IS MY CODE
<?php
$sql = "SELECT * FROM studentlogin WHERE user_name = '$loginName' AND password = '$password'";
$result = mysqli_query($con,$sql) or die(mysqli_error("Error:"));
$count = mysql_num_rows( $result);
//if(mysql_num_rows(resource $result) == 1)
print("$count");
if( $count == 1)
{
header('Location: http:lecturer.html');
}
else
{
echo "Wrong Username or Password";
}
mysqli_close($con);
?>
Warning: mysql_num_rows() expects parameter 1 to be resource, object given in C:\wamp\www\examSystem\login.php on line 57
THIS IS MY CODE
<?php
$sql = "SELECT * FROM studentlogin WHERE user_name = '$loginName' AND password = '$password'";
$result = mysqli_query($con,$sql) or die(mysqli_error("Error:"));
$count = mysql_num_rows( $result);
//if(mysql_num_rows(resource $result) == 1)
print("$count");
if( $count == 1)
{
header('Location: http:lecturer.html');
}
else
{
echo "Wrong Username or Password";
}
mysqli_close($con);
?>
- Delta90
- [ 1 ] Thanks
- wordpressguru
- [ 1 ] Thanks
- vmb2013 Banned
- [1] reply
- wordpressguru
- [1] reply
- cristinaemerson84 Banned
- [ 1 ] Thanks
- lloydblinks
Next Topics on Trending Feed
-
8