Changes between Initial Version and Version 4 of Ticket #5178
- Timestamp:
- 10/13/2007 12:55:42 AM (18 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #5178
-
Property
Status
changed from
new
toclosed
-
Property
Resolution
changed from
to
fixed
-
Property
Summary
changed from
New $wpdb methods: db_insert(), db_update()
toNew $wpdb methods: insert(), update()
-
Property
Status
changed from
-
Ticket #5178 – Description
initial v4 8 8 * @return mixed results of $this->query() 9 9 */ 10 function db_insert($table, $data) {10 function insert($table, $data) { 11 11 $data = add_magic_quotes($data); 12 12 $fields = array_keys($data); … … 22 22 * @return mixed results of $this->query() 23 23 */ 24 function db_update($table, $data, $where_col, $where_val){24 function update($table, $data, $where_col, $where_val){ 25 25 $data = add_magic_quotes($data); 26 26 $bits = array(); 27 27 foreach ( array_keys($data) as $k ) 28 28 $bits[] = "`$k`='$data[$k]'"; 29 $where_val = $ wpdb->escape($where_val);29 $where_val = $this->escape($where_val); 30 30 return $this->query("UPDATE $table SET ".implode(', ',$bits)." WHERE $where_col = '$where_val' LIMIT 1"); 31 31 }