From: Domas Mituzas Date: Mon, 6 Sep 2004 08:30:05 +0000 (+0000) Subject: extend makeList so it could include database field names X-Git-Tag: 1.5.0alpha1~2091 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=2d344ad9a84eee2066e53345380787abb47f285f;p=lhc%2Fweb%2Fwiklou.git extend makeList so it could include database field names --- diff --git a/includes/Database.php b/includes/Database.php index 829bb56a98..a0e62f97df 100644 --- a/includes/Database.php +++ b/includes/Database.php @@ -17,6 +17,8 @@ define( 'LIST_COMMA', 0 ); define( 'LIST_AND', 1 ); /** @todo document */ define( 'LIST_SET', 2 ); +/** @todo document */ +define( 'LIST_NAMES', 3); /** Number of times to re-try an operation in case of deadlock */ define( 'DEADLOCK_TRIES', 4 ); @@ -780,6 +782,7 @@ class Database { * $mode: LIST_COMMA - comma separated, no field names * LIST_AND - ANDed WHERE clause (without the WHERE) * LIST_SET - comma separated with field names, like a SET clause + * LIST_NAMES - comma separated field names */ function makeList( $a, $mode = LIST_COMMA ) { if ( !is_array( $a ) ) { @@ -804,7 +807,7 @@ class Database { if ( $mode == LIST_AND || $mode == LIST_SET ) { $list .= $field.'='; } - $list .= $this->addQuotes( $value ); + $list .= ($mode==LIST_NAMES?$value:$this->addQuotes( $value )); } } return $list;