What I have now is a DB table that holds my configuration variables for my news script. Right now it has one row and each variable has one column and one entry. Although every time I add a new variable I have to modify my script. Here is a sample of what I have....
$config_query = mysql_query("SELECT * FROM config WHERE config_id='1'");
while ($newarray = mysql_fetch_array($config_query)){
$config['id'] = $newarray['config_id'];
$config['sql_prefix'] = $newarray['config_sql_prefix'];
$config['path'] = $newarray['config_path'];
}
I would like to change my DB so it only has two columns variable_name and variable_value (Like a phpbb forum). That way when I add a variable I can select the columns instead of the rows, and won't have to modify my script all the time.
I just want to know the best way to query the new DB and put all of the variables into an array named $config like my code above.