- Impact
- 16
Hey,
^^^^^< Doesn't work 
Basically its retrieving settings from a database, i need it to name the variable based on its $key. But its all quite confusing and i can't figure out how to do it. I know i can do it with an array, say $settings[$key]. But i just want the seperate variables. Is it possible?
So all i want is the key as the variable name.
PHP:
$query = mysql_query("SELECT * FROM `table`");
$setprep = mysql_fetch_assoc($query);
foreach ($setprep as $key=>$value) {
$keyname = "$key";
$keyname = $value;
}
Basically its retrieving settings from a database, i need it to name the variable based on its $key. But its all quite confusing and i can't figure out how to do it. I know i can do it with an array, say $settings[$key]. But i just want the seperate variables. Is it possible?
So all i want is the key as the variable name.





