The nature of the alternative table queries, as far as I know, are not prepared statements. But you have to call the function beginTransactionand commit()for the majority of queries, changing table.
$dbh->beginTransaction();
$sth = $dbh->exec("DROP TABLE fruit");
$sth = $dbh->exec("UPDATE dessert
SET name = 'hamburger'");
$sth = $dbh->exec("ALTER TABLE `dessert` ADD `field1` VARCHAR(24) NOT NULL");
$dbh->commit();
Although you can use the prepared notes and perform as far as I know.
Note:
MySQL implicitly calls the commit () function in queries CREATE TABLEand DROP TABLEtherefore rollback is not possible.
, alter table, , ( ) db, PDO inout. , .