Ok i been doing a little editing needs some help im a noob. [code]$link =mysql_connect($hostname,$username, $password) OR DIE ("Unable to connect to database! Please try again later."); mysql_select_db($dbname); $arr_b = array("x500y500","x510y500"); $arr_r = array("x500y510","x500y520","x510y510","x510y520"); for ($i=0; $i < count($arr_b); $i++){ $coord_taken .= mysql_query("SELECT * FROM coordsTaken WHERE xyPOS = '$arr_b[$i]'"); $coord_taken .= mysql_query("SELECT * FROM coordsReserved WHERE xyPOS = '$arr_b[$i]'"); echo "Already bought"; } for ($i=0; $i < count($arr_r); $i++){ $coord_reserv .= mysql_query("SELECT * FROM coordsReserved WHERE xyPOS = '$arr_r[$i]'"); $coord_reserv .= mysql_query("SELECT * FROM coordsReserved WHERE xyPOS = '$arr_r[$i]'"); echo "Already reserved"; } mysql_close($link); ?>[/code] Here is what im trying to do. I have created two arrays with identical values that are in the database. I want to step through the database and select the matching rows. If there is a matching row display a message. I know i need a if statement in there. But i am unsure if the select statements are correct. thanks again