enableExceptions(true); foreach( $stmts AS $stmtStr ){ $stmtStr = trim($stmtStr); if( !$stmtStr ) continue; $st = $db->prepare($stmtStr .';'); $st->execute(); //$id = $db->lastInsertRowID(); //if( $id ){ echo "lastInsertRowID() -> $id\n"; } $st->close(); } $db->close();