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; } Link to comment https://forums.phpfreaks.com/topic/71234-this-script-will-not-pull-data-from-my-mysql-table/ 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. Link to comment https://forums.phpfreaks.com/topic/71234-this-script-will-not-pull-data-from-my-mysql-table/#findComment-358302 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. Link to comment https://forums.phpfreaks.com/topic/71234-this-script-will-not-pull-data-from-my-mysql-table/#findComment-358303 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.