I can't get what I'm doing wrong:
<?
$db = mysql_connect("localhost", "username", "password")
or die("Could not connect"); // Connect to evil database or die if failed
mysql_select_db("betterui_dev",$db);
$SQL=mysql_query("select username, password FROM logintable");
while($row=mysql_fetch_array($SQL))
{
if($username === $row[0] && $password === $row[1])
{
return true;
print "Holy one, you have logged in";
}
}
return false;
print "You are unholy and the forces of the divine will not let you enter, stay away beast!";
?>
This gives me:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/betterui/public_html/users/ychen/authenticate.php on line 10
I checked php for the right argument but I didn't find an error, please help me!