1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-18 20:31:19 +02:00

Abstract UPDATE

This commit is contained in:
Jakub Vrana
2013-07-05 15:32:15 -07:00
parent 1f7fa44923
commit b7739dc0bd
3 changed files with 32 additions and 16 deletions

View File

@@ -21,6 +21,18 @@
return queries("DELETE" . ($limit ? limit1($query, $queryWhere) : " $query$queryWhere"));
}
/** Update data in table
* @param string
* @param array
* @param string " WHERE ..."
* @param int 0 or 1
* @return bool
*/
function update($table, $set, $queryWhere, $limit = 0) {
$query = table($table) . " SET" . implode(",", $set);
return queries("UPDATE" . ($limit ? limit1($query, $queryWhere) : " $query$queryWhere"));
}
/** Insert data into table
* @param string
* @param array