I have a mysql table for my setups, it contains basically three fields: 'id','variable','value'.
The table is already filled with the variables i want to use for my website, now i just want my index page to get the different variable out of the table with the value as its value. Is that even possible?
so lets say i have a variable in my table called 'header_color' the value in that table row is 'FFF'
i want my index to get all variable from the database (through a while??) with again its value as a value.
This is my thought:
Code: Select all
$sql = mysql_query("SELECT * FROM setup");
while ($res = mysql_fetch_array($sql)){
$res[variable]; = $??my_variable??;
$myvariable = $res[value];
}
maybe i need to create an array or something i have no idea.
Hope you guys can help me.