I’m trying to update multiple rows that all share the same field names.
The structure is like:
+---+-------+--------+
|id | name | value |
+---+-------+--------+
| 1 | color | red |
| 2 | fruit | apple |
| 3 | day | friday |
+---+-------+--------+
So, something like :
$config_data = "UPDATE system_config SET color = '$_POST[color]', fruit = '$_POST[fruit]', day = '$_POST[day]'";
$success = mysql_query($config_data);
… will not work. How would I perform this query?
Try
instead.It’s necessary to put in more queries in this case