<?php
echo "$cookieusername $cookiepassword";
$link = mysql_connect("localhost", "username", "password")
or die("Could not connect");
mysql_select_db("database") or die("Could not select database");
$result = mysql_query('SELECT * FROM table WHERE cookieuser="$cookieusername" AND cookiepass="$cookiepassword"');
$num = mysql_num_rows($result);
if ( $num != 0 ) {}
else {exit ("Invalid Username or Password");}
?>
I keep getting this Error
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in //mysite/ on line 18
Invalid Username or Password
line 18 = $num = mysql_num_rows($result);