I'm not sure, but maybe something like this?
$sql = SELECT urlfield FROM table_name;
if($url != $sql) {
echo("No URL found.");
} else {
header("Location:/something/file.php");
}
I'm not sure if you are checking it if someone enters it in a text field or not, and I'm probably wrong. But that might work.