I have a column named what
with values like this:
earth
sun
sea
sky
...
I need to create php variables named as this values and give to that variables the same values.
for example:
$earth = 'earth';
$sun = 'sun';
...
I tried:
$st = $db->prepare("select what from bdef");
$st->execute();
while ($row = $st->fetch()) {
${$row['what']} = $row['what'];
}
echo $earth;
Result: Unknown variable...