Jump to content

variable variable name? multiple result sets?


ahs10

Recommended Posts

so i have for results that i want to run the same code over.  i can't figure out how to get a variable variable name to work in my while loop though.  something to the effect of...

 

$result1 = mysql_query($query1);

$result2 = mysql_query($query2);

$result3 = mysql_query($query3);

$result4 = mysql_query($query4);

 

for ($i = 1; $i < 5; $i++) {

    while ($row = mysql_fetch_array($result[$i])) {

          //here's my code to be repeated on each result, referring to $row and column names like $row['id']

    }

}

 

what's wrong?

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.