I have a 2 column table that stores configuration data, the tables are config and config_settings. There are 10 rows in those 2 columns. I have a page where I allow editing of those settings, then I submit them into the database. The way I'm currently doing it is like so:
$query = "UPDATE config SET config_setting = '$value' where config = '$colname'"; $db->dbQuery($query); //This is a db class I use $query = "UPDATE config SET config_setting = '$value' where config = '$colname2'"; $db->dbQuery($query);
and so on and so forth. I was thinking I might be able to read my settings posted from the previous page via $_POST variables into an array then do a foreach through the array and submit to the database like that, but I can't figure out how, or if it's possible.
Am I ok doing what I am doing now, or is there a cleaner way of doing it?
Thanks for your help!