I have a database which contains the link to audio files. I am trying to play them one after the other using the HTML audio tag. Presently I am using PHP. My code -
$sql = "SELECT * FROM table";
$r = mysql_query($sql);
while($row = mysql_fetch_array($r)) {
$id = $row["audID"];
$audsq = "SELECT * FROM table2 WHERE id ='$id'";
$resultaud = mysql_query($audsq);
//Here I want to write a code to clear div="test"
PlayAud(resultaud);
sleep(2); ///Not Sure
}
I am passing the link to aud file for the html to load and in
<?php
PlayAud($res) {
$raud = mysql_fetch_array($res); ?>
<div id="test">
<audio> ... </audio>
</div>
<?php }?>
Can some one tell me if I am doing it right ? also each clip is of 2 seconds hence I need to wait in the while loop for 2 seconds. If there is any other way can you suggest me?
Thank You