Hiya, I'm making a login script and have come pretty far but can't get this mysql fetch row statement to function properly. Here is my code that links to it.
When I try logging in with the correct password it says incorrect password. :/
$check = mysql_query("SELECT username, password, level FROM users WHERE username = '".$_POST['uname']."'") or die(mysql_error());
$checknumrow = mysql_num_rows($check);
if ($checknumrow == 0)
die('That username does not exist in our database.');
$info = mysql_fetch_row($check);
$_POST['passwd'] = stripslashes($_POST['passwd']);
$info['password'] = stripslashes($info['password']);
$_POST['passwd'] = md5($_POST['passwd']);
if ($_POST['passwd'] != $info['password'])
die('Incorrect password, please try again.');
I don't think I'm using it correctly but how would I make it be able to execute the code below it? Thanks in advanced.