I have a table vars
containing variables only. There are three columns:id
- idname
- variable nameval
- variable value
I need to declare that variables and give them corresponding values, something like:
$stmt = $db->query("SELECT * FROM vars order by id asc");
while($row = $stmt->fetch()){
'$' . $row['name'] = "'" . $row['val'] . "'";
}
echo $somevariable...
Any help?