Hi Chris,
Thanks, I finally did do something very like that:
$result = mysql_db_query($dbname, $query, $link) or die ("Could not open the Database, Please email bob");
$myrow = mysql_fetch_array($result);
//$n=0 ; ($n here was to get the midi id in the database to be included)
do {
// if ($n > 0) {
$midis["$n"]["Title"]=$myrow["Title"] ;
$midis["$n"]["File"]=$myrow["File"] ;
$midis["$n"]["File_size"]=$myrow["File_size"] ;
$midis["$n"]["Play_length"]=$myrow["Play_length"] ;
// }
$n=$n+1 ;
} while ($myrow = mysql_fetch_array($result));
I checked it with an:
echo $midis[$z] [Title] ;
and varied $ Worked fine but I ran into another stumbling block. I am using the meta refresh to signal the end of one midi and that another should begin:
<meta http-equiv="refresh" content="100; url=<?php echo $PHP_SELF;?>">
100 is seconds and that will be replaced by a variable which represents the play time of the midi in sec + The download time of the next midi based on a connect speed of 28k.
problem is that a variable needs to be passed so the next time through the program, it knows what to do. When I tried to include a /1 in the url with another <?php echo $n?> above it killed it by tacking on /1 then /1/1 then /1/1/1 with each time through.
Do you have any ideas on how to pass a variable so I can tell it ok, so the first midi is finished, now find the next.
I was hoping to be able to save the array so the database did not have to be re-read each time and that failed also, even though I declared midis to be global at the top before the head info.
At this time I can only see re-reading the database each time and then picking a random midi.
bob betts
http://marinelifemag.com