TJMAudio Posted September 30, 2007 Share Posted September 30, 2007 Well, it pulls all but 1 row for some reason. When I call this, the User ID and Username gets pulls, however the Password doesn't. When I try to run this script, the password should be something, but it comes up blank. I have no idea what is wrong with this. My database row for the password is named 'password'. <?php $action = $_GET['a']; switch($action) { case 'login': $username = $_POST['username']; $password = $_POST['password']; $loginquery = mysql_query("SELECT * FROM users WHERE username='$username'"); if(mysql_num_rows($loginquery) < 1) { echo "<script>header.location.href='index.php?m=login&e=1'</script>"; exit; } while($users = @mysql_fetch_row($loginquery)) { $userid = $users['id']; $usern = $users['username']; $userpass = $users['password']; if($password == $userpass) { $_SESSION['username'] = $username; echo "<script>header.location.href='index.php?m=home'</script>"; exit; } else { echo "<script>header.location.href='index.php?m=login&e=1'</script>"; exit; } } break; } Quote Link to comment Share on other sites More sharing options...
TJMAudio Posted September 30, 2007 Author Share Posted September 30, 2007 Apparently it is also not retrieving the userid as well. Quote Link to comment Share on other sites More sharing options...
TJMAudio Posted September 30, 2007 Author Share Posted September 30, 2007 Tag this as solved.. was using mysql_fetch_row instead of mysql_fetch_array. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.