I have a MySQL table like so
id
name
email
(one entry could be like [1,Bob,
What I want to do is run a script through a user table, pulling all the data, and setting the data to variables like the field names they we’re pulled from
For example
$id = 1
$name = “Bob”
$email = “
I did it once before, yet that was like 2 years ago, and I just started up again after taking a break…and it’s not coming back so fast.
The way I had it set up before is that I could append a string before the field name, like so: (using ‘user_’ so variables don’t get mixed up in the script somewhere)
$user_id = 1
$user_name = “Bob”
$user_email = “
I think it used a loop, and the eval() statement, yet other than that, I’m lost
Doubt it will help yet here’s what I have so far:
[code=php]
$val = $db->query(“SELECT * FROM users WHERE id = ‘$userid'”);
while($vals = $db->fetch_array($val)){
eval(“$user”.$vals[0].” .= “$vals[0]”;”);
}