I have SQL code that executes CREATE TABLE
and DROP TABLE
in the same query. When I run it, it prints bool(false)
meaning error. Can it be done in one query?
$dbh = new PDO("sqlite::memory:");
$stmt = $dbh->prepare("create table a ( i int, j int);drop table a");
var_dump($stmt);
I don't know why but it works if I try it again.