stuck on a small loop im doing which assigns the value from a mysql query array to a variable. Every time the loop runs I want it to assign to variables with different names, increasing by one each time.
i am stuck on how to assign a variable name that contains an existing variable.
Code: Select all
$table_$x = $row[$x]$table_0, $table_1, $table_3 etc
and have their values as follows
$table_0 = $row[0]
$table_1 = $row[1]
this loop runs until $x = mysql_num_rows.
as you can see i am stuck on the part which assigns the variable names. i get syntax errors.
i have tried "$table_"."$x" and also $table_.$x but no luck.
could anybody point me in the right direction?