return true;
}
+ function begin() {
+ return queries("BEGIN TRANSACTION");
+ }
+
}
;
}
- function begin() {
- return queries("BEGIN TRANSACTION");
- }
-
function last_id() {
global $connection;
return $connection->result("SELECT SCOPE_IDENTITY()"); // @@IDENTITY can return trigger INSERT
//! support empty $set in insert()
+ function begin() {
+ return true; // automatic start
+ }
+
}
return apply_queries("DROP TABLE", $tables);
}
- function begin() {
- return true; // automatic start
- }
-
function last_id() {
return 0; //!
}
$cols = array_keys($fields);
preg_match_all('~(?>"[^"]*"|[^"\\r\\n]+)+~', $file, $matches);
$affected = count($matches[0]);
- begin();
+ $driver->begin();
$separator = ($_POST["separator"] == "csv" ? "," : ($_POST["separator"] == "tsv" ? "\t" : ";"));
$rows = array();
foreach ($matches[0] as $key => $val) {
}
$result = (!$rows || $driver->insertUpdate($TABLE, $rows, $primary));
if ($result) {
- queries("COMMIT");
+ $driver->commit();
}
queries_redirect(remove_from_uri("page"), lang('%d row(s) have been imported.', $affected), $result);
- queries("ROLLBACK"); // after queries_redirect() to not overwrite error
+ $driver->rollback(); // after queries_redirect() to not overwrite error
}
}