yes its that old one again!
but this time i am having real problems.
i am doing a tracklisting for a radio station, where they fill out a form with track 01, 02, 03 etc details and each of these is saved with variables i.e. $track01_artist, track_01title, $track01_label etc.
i have a table (html) where the tracks are listed. to save space i need the table to only have 6 rows if there are only 6 tracks in the list and only 7 rows if there are only 7 tracks etc etc.
so i have a php variable $counter and i am using a standard loop where id the user has entered 6 as the number of tracks, the loop runs 6 times and my variable names use the $counter variable within them, except i cannot get the **** to work, because php won't understand my variable $counter inside the variable $track01_artist for example.
here's a section of what i have with some notes:
<? $counter=1;
while ($counter<=$tracks_number)
{
?>
<tr>
<td>Track <? print("0$counter"); ?>: </td>//this works fine!
<td><? print("$track_0{$counter}artist"); ?>//this doesn't work????
//it actually returns "1artist", "2artist" etc. etc.
//the following ones have the same problem
, <? print("$track_0{$counter}title"); ?>, <? print("$track_0{$counter}label"); ?></td>
</tr>
<? $counter++;
}
?>
OK, any help greatly appreciated.