I have two queries that I need to execute in a PHP script, but if either of them fails then I don't want to execute either

any idea on how to do this?