I have an array of all the tables in my database and I need to go in a delete the record if the applicationid=123 or familyid=123. But some tables dont have any of those feilds is there a way I can just skip the table if that is the case? instead of it erroring.
$query2="DELETE FROM "$table[$x]" WHERE applicationid = '517f20805d9bd0961c76e8f544ee6f76' OR house1ID = "$r['1']" OR house2ID ="$r['2']" OR familyID="$r['1']" OR familyID="$r['2']"";
$result2 = mysql_db_query($aidDB, $query2, $connection);