Okay, I have a MySQL table that stores vars.
It looks something like this
+-------------------+------------------------+
| varname | varcont |
+-------------------+-------------------------+
| $samplevar | asdf |
| $samplevar2 | jkl; |
+-------------------+-------------------------+
So it has 2 columns, a var name column, and one to store the contents of that var. Now, I want to creat a function that will get all the var names and var contents, but then it will store the var contents in the var name. (I am using PHP by the way)
So far I have got something like this:
function GetVars() {
$query = "SELECT * FROM mbvars";
$result = mysql_query($query) or die("Could not execute query");
while($mr = mysql_fetch_array($result)) {
echo "$mr[varname]";
$mr[varname] = $mr[varcont];
echo "$mr[varname]";
}
}
But what is happing is that the var contents are overwriting the var name, where I want it stored to the var name...
Is there anyway of doing this, or is it impossible?