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

Driver specific INSERT INTO

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1484 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana
2010-04-23 09:03:27 +00:00
parent e780f9bb05
commit 341362a8fa
5 changed files with 23 additions and 6 deletions

View File

@@ -193,11 +193,11 @@ function unique_array($row, $indexes) {
*/
function where($where) {
$return = array();
foreach (array("where", "null") as $type) {
foreach ((array) $where[$type] as $key => $val) {
$key = bracket_escape($key, "back");
$return[] = (preg_match('~^[A-Z0-9_]+\\(`(?:[^`]|``)+`\\)$~', $key) ? $key : idf_escape($key)) . ($type == "null" ? " IS NULL" : (ereg('\\.', $val) ? " LIKE " . exact_value(addcslashes($val, "%_")) : " = " . exact_value($val))); // LIKE because of floats, but slow with ints //! enum and set, columns looking like functions
}
foreach ((array) $where["where"] as $key => $val) {
$return[] = idf_escape($key) . (ereg('\\.', $val) ? " LIKE " . exact_value(addcslashes($val, "%_")) : " = " . exact_value($val)); // LIKE because of floats, but slow with ints //! enum and set
}
foreach ((array) $where["null"] as $key) {
$return[] = idf_escape($key) . " IS NULL";
}
return implode(" AND ", $return);
}