dan_t Posted May 2, 2010 Share Posted May 2, 2010 I have this simple form echo <<<EOF <form action="log_user.php" method="post"> Please enter User Id: <input type="text" name="in_userId"> <input type="submit" name="sub_use" value="send"> </form> EOF; and I have this simple run through an array from a database $in_userId = $_POST['in_userId']; //select user info $users_result = "select userId from persinfo where cat_id =1"; $user_result = mysql_query($users_result); while($row = mysql_fetch_array($user_result)) { print($row['userId']).'<br>'; } How can I check this input against a user in the database? I can't seem to get anything to work. Link to comment https://forums.phpfreaks.com/topic/200464-password-check/ Share on other sites More sharing options...
Ken2k7 Posted May 2, 2010 Share Posted May 2, 2010 Why not check in the SQL? $users_result = sprintf("SELECT userId FROM persinfo WHERE cat_id = 1 AND userId = '%s';", mysql_real_escape_string($in_userId)); Link to comment https://forums.phpfreaks.com/topic/200464-password-check/#findComment-1051978 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.