I have a strange behavior in a php script (PHP 8.1) using MariaDB 10.7.5 database.
This one with native SQL works:
$pdo->query("BEGIN");
[ ... some database stuff ... ]
$pdo->query("COMMIT");
But using PDO's own function does not work, it results to "PHP Fatal error: Uncaught PDOException: There is no active transaction in xxxx":
$pdo->beginTransaction();
[ ... some database stuff ... ]
$pdo->commit();
Can someone explain me why?