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:
@@ -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
|
||||
|
Reference in New Issue
Block a user