include("connect.php");
$username=$_POST['username'];
$password=$_POST['password'];
$sql="SELECT * FROM admin WHERE username='$username' and password='$password'";
$result=mysql_query($sql);
// This counts to see how many rows were found, there should be no more than 1
$count=mysql_num_rows($result);
// If result matched $username and $password, table row must be 1
if($count==1){
// Register $myusername, and redirect to file "login_success.php"
session_start();
$_SESSION["logged"] = 1;
header("location:admin.php");
}
else {
$_SESSION["logged"] = 0;
echo "geen rechten!";
}
?>
Hier boven zie je mijn login.php script, alleen hij geeft de volgende error
mysql_num_rows(): supplied argument is not a valid MySQL
ik heb de foutmelding gegoogled maar werd er niet veel wijzer van