I'm building a config table with two columns, config_name and config_value. I insert multiple rows in one statement:
INSERT INTO ".$dbPrefix."config (config_name,config_value) VALUES
('domain','$domain'),
('forest_root','$fr_if'),
('userGroup','$userGroup'),
('adminGroup','$adminGroup');
The config_name column is a primary key. How would I change this statement to automatically update the config_value if the config_name already exists?
You could try this syntax:
Docs can be found here.
You're trying to do an upsert, and I think this may help: http://database-programmer.blogspot.com/2009/06/approaches-to-upsert.html