mysql_result()
Posted: Tue Jun 14, 2005 10:36 am
Hey this is my first post. Found this site via google.
I am installing a php script that my friend had someone make him.
I have a login form for the admin area. However, when i try to login it will give me the following error:
Can anyone suggest why this is happening?
I am installing a php script that my friend had someone make him.
I have a login form for the admin area. However, when i try to login it will give me the following error:
However, i look at the PHP behind this and i see the following (code started from line 40):Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /home/dc4u/public_html/control/index.php on line 48
Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /home/dc4u/public_html/control/index.php on line 50
Code: Select all
echo($login_screen);
echo("<script>alert('Your session data was not found, please login.');</script>");
session_destroy();
mysql_close;
exit;
}
} else {
$res = mysql_query("select value from admin where field='login'");
$db_login = mysql_result($res, 0);
$res = mysql_query("select value from admin where field='passwd'");
$db_passwd = mysql_result($res, 0);
if ($_SESSION['asess_name'] != $db_login || $_SESSION['asess_passwd'] != md5($db_passwd)) {
echo($login_screen);
echo("<script>alert('Invalid login, please check your admin username and password.');</script>");
session_destroy();
mysql_close;
exit;
}