Changeset 6240 for trunk/wp-includes/wp-db.php
- Timestamp:
- 10/13/2007 02:36:38 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/wp-db.php
r6239 r6240 267 267 * @param string $table WARNING: not sanitized! 268 268 * @param array $data should not already be SQL-escaped 269 * @param mixed $where_col_or_array if a string, it represents the column of the WHERE statement. If an array (named), it can represent multiple col = 'value' pairs that will be joined with ANDs WARNING: the column names are not sanitized! 270 * @param string $where_val the value of the WHERE statement. Should not already be SQL-escaped. 269 * @param array $where a named array of WHERE column => value relationships. Multiple member pairs will be joined with ANDs. WARNING: the column names are not currently sanitized! 271 270 * @return mixed results of $this->query() 272 271 */ 273 function update($table, $data, $where _col_or_array, $where_val=NULL){272 function update($table, $data, $where){ 274 273 $data = add_magic_quotes($data); 275 274 $bits = $wheres = array(); … … 277 276 $bits[] = "`$k` = '$data[$k]'"; 278 277 279 if ( is_string( $where_col_or_array ) ) 280 $wheres = array( "$where_col_or_array = '" . $this->escape($where_val) . "'" ); 281 elseif ( is_array( $where_col_or_array ) ) 282 foreach ( $where_col_or_array as $c => $v ) 278 if ( is_array( $where ) ) 279 foreach ( $where as $c => $v ) 283 280 $wheres[] = "$c = '" . $this->escape( $v ) . "'"; 284 281 else
Note: See TracChangeset
for help on using the changeset viewer.