1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-29 01:00:07 +02:00

Finish SQLite

Don't require num_rows
This commit is contained in:
Jakub Vrana
2010-05-27 16:10:17 +02:00
parent 55140a6ae8
commit 782921b671
12 changed files with 121 additions and 94 deletions

View File

@@ -767,6 +767,19 @@ if (!defined("DRIVER")) {
return queries("INSERT INTO " . table($table) . " (" . implode(", ", array_keys($set)) . ")\nVALUES (" . implode(", ", $set) . ")");
}
/** Insert or update data in the table
* @param string
* @param array
* @return bool
*/
function insert_update($table, $set) {
foreach ($set as $key => $val) {
$set[$key] = "$key = $val";
}
$update = implode(", ", $set);
return queries("INSERT INTO " . table($table) . " SET $update ON DUPLICATE KEY UPDATE $update");
}
/** Get last auto increment ID
* @return string
*/
@@ -822,6 +835,14 @@ if (!defined("DRIVER")) {
return $connection->result("SHOW CREATE TABLE " . table($table), 1);
}
/** Get SQL command to truncate table
* @param string
* @return string
*/
function truncate_sql($table) {
return "TRUNCATE " . table($table);
}
/** Get SQL command to change database
* @param string
* @return string