Hi,
I'm developing a small application that needs to repeated call on a series of recordsets that are similarly named. What I would like to do is call these recordsets in turn, display the contents. Repeat for each of the of them.
Assuming I have recordsets name rset0, rset1 ... rset9. The recordsets themselves have been declared earlier. The following code doesn't work obviously but i hope shows what I am trying to achieve.
<?php for ($i = 0; $i <= 9; $i++) {
mysql_data_seek($rset.$i, 0);
while ($row_rset.$i = mysql_fetch_assoc($rset.$i)) {
echo "rset".$i." - data - ".$row_rset.$i['fruit'];
}
?>
I would hope that this would return:
rset0 - data - apple
rset0 - data - pear
rset0 - data - lemon
rset1 - data - orange
rset1 - data - melon
.
.
.
rset9 - data - plum
rset9 - data - peach
Can anyone help me with the syntax of concatenating the variables so that it PHP reads $rset.$i as $rset0, $rset1, etc on each iteration. I'm not entirely sure that this is possible to achieve, i just hope there is.
Many thanks for your time.
C Shepherd