Jump to content

[SOLVED] $my{$f} = $v; not working?


scarhand

Recommended Posts

Trying to get fields from a mysql table into variables prefixed with $my

 

So I want the 'username' value to be stored under a variable called $myusername

 

Heres code:

 

    while ($row = mysql_fetch_assoc($sql))
    {
      foreach ($row as $f => $v)
        $my{$f} = $v;
    }

Link to comment
https://forums.phpfreaks.com/topic/165070-solved-myf-v-not-working/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.