I'm sure that my problem is caused by a really stupid typo, but I can't find it. I'm trying to grab a column from a database, and then go through it as an array in order to find a username. However, my foreach loop only checks the first username in the column, and then stops. I searched the web for a similar problem, and then I scoured the forums, and it appears that no one else has this problem, which is why I'm betting that it's a typo, but still, it's stumping me... PLEASE HELP!!! [code] <?php $name = $_POST["compid"]; $pass = $_POST["pass"]; $con = mysql_connect("localhost","root","quantico"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("argo", $con); $results = mysql_fetch_array(mysql_query("SELECT user FROM customers",$con)); $correctUser = 0; foreach ($results as $value) { if ($name == $value) { $correctUser = 1; } } if ($correctUser == 0) { $theEnd = <<<END <script language='Javascript' type='text/javascript'> alert("We do not have that username on file."); </script> END; die($theEnd); } [/code] There's more code, but I didn't think it was part of the problem. If this part of the code isn't the problem, I'll post the rest. Thanks in advance, Guy