winnij Posted July 7, 2006 Share Posted July 7, 2006 Hello,For a website php and mysql are used. A recordset contains names and a filelocation.Each name an each fillelocation needs to become a variable. I would achieve that by a for loop, see example.for($i=0; $totalRows_RS-1 ; $i++){ ($tab +($i+1)) = $row_RS['name']; ($link + ($i+1)) = $row_RS['location'];}PHP returns Parse error: parse error, unexpected '='..Has anyone an idea to solve this problem? Link to comment https://forums.phpfreaks.com/topic/13929-generate-variable-name/ Share on other sites More sharing options...
Zane Posted July 7, 2006 Share Posted July 7, 2006 because you're using the wrong syntaxdo this[code]${"tab".$i++} = $row_RS['name'];[/code] Link to comment https://forums.phpfreaks.com/topic/13929-generate-variable-name/#findComment-54301 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.