Forum Moderators: coopster
I'm retrieving large numbers of variables (100) from a database using PHP/MySQL. At the moment I list all 100 variabels as per below. Is there a way to simplify this piece of code?
$result = $connector->query("SELECT * FROM table1 WHERE username='$username' ");
while ($row = $connector->fetchArray($result)){
$q1=$row['q1'];
$q2 = $row['q2'];
$q3=$row['q3'];
$q4=$row['q4'];
$q5=$row['q5'];
$q6=$row['q6'];
$q7=$row['q7'];
$q8=$row['q8'];
$q9=$row['q9'];
...
$q100=$row['q100'];
Any suggestions most welcome!
Ed