I have a SQL transaction similar to the one below. I am unable to obtain the result of the 3rd query in the transaction using PHP function PDO::fetch()
$database = DatabaseFactory::getFactory()->getConnection();
$sql = "BEGIN;
DELETE FROM users WHERE ID = 4;
UPDATE audit SET nousers= nousers - 1 WHERE ID = 4;
SELECT nousers FROM audit WHERE ID = 4;
COMMIT;";
$query = $database->prepare($sql);
$query->execute();
How do I use $query->fetch() to obtain the result of the 3rd query in the transaction?