radar Posted August 30, 2006 Share Posted August 30, 2006 Okay I have a table in my database called config... this table has 2 cells.. one called config_name and the other config_value...Well I need to be able to write to this via a form... The only thing thats ever going to change is config_value -- so how do I take the contents of the form and put it into the database?Only way i could think of would be to do every query individually.. which would suck... then i thought someone here might now a bit about doing something like this.. so let me know.. and thanks in advance... Quote Link to comment Share on other sites More sharing options...
simcoweb Posted August 30, 2006 Share Posted August 30, 2006 Will there be multiple config_name and config_value entries or just one that you change the value you of from time to time? Quote Link to comment Share on other sites More sharing options...
radar Posted August 30, 2006 Author Share Posted August 30, 2006 I guess that would have been a good thing to include... there will be multiple entries.. and here is a sample take on it..config_name config_valuedomainname www.mysiste.comsite_name My Web Sitesite_descrip the elitest of the elitesite_enable 1req_act 0req_vis_act 1It is in that type of setup... goes on an on holds all the important configuration of my site in this table.... Quote Link to comment Share on other sites More sharing options...
Barand Posted August 30, 2006 Share Posted August 30, 2006 I'd use an ini file formatconfig.php[code]domainname=www.mysiste.comsite_name=My Web Sitesite_descrip=the elitest of the elitesite_enable=1req_act=0req_vis_act=1 [/code]To read it[code]$config = parse_ini_file('config.php', false);[/code]$config now is an array[code]Array( [domainname] => www.mysiste.com [site_name] => My Web Site [site_descrip] => the elitest of the elite [site_enable] => 1 [req_act] => 0 [req_vis_act] => 1)[/code]echo $config['site_name'] --> 'My Web Site' ; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.