scarhand Posted July 7, 2009 Share Posted July 7, 2009 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 More sharing options...
scarhand Posted July 7, 2009 Author Share Posted July 7, 2009 NEvermind, got it: ${"my$f"} = $v; Link to comment https://forums.phpfreaks.com/topic/165070-solved-myf-v-not-working/#findComment-870443 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.