sir pannels
08-24-2006, 11:38 AM
Hi there,
Having some issues with a variable.
I have a query running that returns 10 results of data, in a while loop.
During the while is open it does something like :
$data = Result Data
For each row, and then after prints..
PRINT $data;
That works however I'm now trying to give dymanic variables, so I can count the rows. So id have a count in the row return ..
$count = $count +1;
$data = Result Data
And then I would like to use that count to name each row of data, so instead of
$count = $count +1;
$data = Result Data
I then get ..
$count = $count +1;
$data.$count = Result Data
// This should be called using PRINT $data1;
That's what I'm after, however stuggilin ammending the count to the end of the variable name, tried a few ways but not got anywhere..
Is this not possible? Or is there special syntax to assign another variable to the variable name?
Or should I be using another while or foreach statement?
Any information be apperciated.
Cheers all
Sir P :D
Having some issues with a variable.
I have a query running that returns 10 results of data, in a while loop.
During the while is open it does something like :
$data = Result Data
For each row, and then after prints..
PRINT $data;
That works however I'm now trying to give dymanic variables, so I can count the rows. So id have a count in the row return ..
$count = $count +1;
$data = Result Data
And then I would like to use that count to name each row of data, so instead of
$count = $count +1;
$data = Result Data
I then get ..
$count = $count +1;
$data.$count = Result Data
// This should be called using PRINT $data1;
That's what I'm after, however stuggilin ammending the count to the end of the variable name, tried a few ways but not got anywhere..
Is this not possible? Or is there special syntax to assign another variable to the variable name?
Or should I be using another while or foreach statement?
Any information be apperciated.
Cheers all
Sir P :D