$connection = mysql_connect('localhost',$user,$pass); mysql_select_db($dbname, $connection); $vault_id = mysql_real_escape_string( $vault_id ); $combo = mysql_real_escape_string( $combo ); $var = "SELECT * FROM Vaults WHERE Vault_ID='". $vault_id . "'"; $result = mysql_query($var , $connection); while($row = mysql_fetch_array($result)) { if($row['Vault_ID'] == $vault_id && $row['Combo'] == $combo) { $var = "SELECT Contents FROM Vaults WHERE Vault_ID='". $vault_id . "'"; $return = mysql_query($var , $connection); return $return; } else { return 'FALSE'; } } Code (markup): What I am trying to do is find out if the variable $vault_id and $combo correspondingly match up with two columns Vault_ID and Combo both in the same row. If not it returns false. Otherwise it gets the value of the contents column in that same row. For example: Vault_ID | Combo | Contents ---------------------------------- 01234 01-01-01 Vault Contents 12345 02-02-02 More Contents If my $vault_id == '01234' and $combo == '01-01-01' then it would return "Vault Contents" or if $vault_id == '12345' and $combo == '02-02-02' it would return "More Contents" otherwise it returns false. However it doesn't do this at all. It doesn't return a MySQL error but my host is weird about PHP/MySQL errors so there may be one I am not sure. Do you guys see an error or a mistake I made in syntax. Thanks for at least reading this and attempting to help me.