If $Field doesn't correspond to an actual field in my mySQL database I get an error. How can I trap if an error occurs (eg. ErrorFlag = True and then continue with the rest of the my code?

PHP Code:
$SQL "SELECT * FROM MyTable ORDER BY $Field";

//Instead of die I want to trap error then continue
$query mysql_query($SQL) or die("Error getting details<br>" .mysql_error());