<?php
session_start();
function CheckCredentials($username, $password){
$query = mysql_query("SELECT * FROM blog_users WHERE rank = 'Administrator' LIMIT 1");
while ($result = mysql_fetch_array($query)) {
if ($username != $result['username'] || $password != $result['password']) {
echo "NOT LOGGED IN!";
} else {
echo "Hai";
}
}
}
CheckCredentials($_SESSION['username'], $_SESSION['password']);
?>
The error I get is:
Quote
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in (PATHTOMYSCRIPT) on line 5
I really don't understand why I'm getting the error. If it helps, here is the structure of blog_users:
id username password rank ---------------------------------------------------------- 1 Admin 21232f297a57a5a74389 Administrator
I also have another table in my blog_db but that's named blog_entries and is only for entries.
I'd appreciate it if someone could help me

New Topic/Question
Reply




MultiQuote





|