Hi Ros,
This bit ...
if (mysql_numrows($result) == 1) {
$_SESSION['name'] = mysql_result($result,0,"name");
$_SESSION['username'] = mysql_result($result,0,"username");
echo "You're logged in. Feel free to return at a later time.";
}
... looks like where the problem might be occurring.
Stick an else clause at the end and echo something to let you know what's going on.
$numrows = mysql_numrows($result);
if($numrows == 1) {
$_SESSION['name'] = mysql_result($result, 0, 0);
//$_SESSION['username'] = mysql_result($result,0,"username");
echo "You're logged in. Feel free to return at a later time.";
} else {
echo "Details are wrong ... numrows = ".$numrows;
}
Hope that helps.
Paul 🙂
PS ... I notice also that the username is not included in your select sql so the line ...
$_SESSION['username'] = mysql_result($result,0,"username");
... won't work as expected. Don't think this is crucial to your problem, though.