Nevermind. I apply the loop to the array instead of the query; what a moron! Just goes to show, you can't legislate for stupidity.
++A
:q
++A
:q
PHP Code:
$data = array('col1' => 'one',
'col2' => 'two',
'col3' => 'three'
);
foreach ($data as $field => $value) {
$list[] = $field.'='."'".mysql_real_escape_string($value)."'";
}
$fields = implode(', ', $list);
$query = "UPDATE table_name SET ".$fields." WHERE some_column=some_value";