Here's how we can do it:
$ok = true;
$ok = $ok && mysql_query('START TRANSACTION');
$ok = $ok && shops_AddShop($shop);
$ok = $ok && ($shop['id'] = mysql_insert_id());
$ok = $ok && shops_UpdateCategories($shop);
If one of the MySQL queries failed, I can do a rollback and reverse the appropriate changes. It's much better taking advantage of the short circuit evaluation as talked about earlier on.
In that case you will have a more stable application.