Sorry to mislead you by not including the array extraction statement. This example does work (tested).
PHP Code:
<?
$link = mysql_connect('localhost', 'db_username', 'db_password');
$db_selected = mysql_select_db('yourusername_test', $link);
$compare = $_GET['action'];
$sql = "select domain from hlsremote where domain='".$compare."'";
$result = mysql_fetch_array(mysql_query($sql));
if ($result['domain'] == $compare) {
echo "it is there in the database.";
} else {
echo "that domain is not in the database.";
}
?>