Jump to content

audio tag


etsted
 Share

Recommended Posts

this audio tag keeps duplicating my mp3 files

 

$mp3 = ""; // get all the mp3 files from the DB $sql = "SELECT * FROM mp3"; $query = mysqli_query($con, $sql); while($row = mysqli_fetch_array($query) ) { $id = $row['id']; $tittel = $row['tittel']; $description = $row['description']; $username = $row['username']; $file_url = $row['file_url']; $upload_date = $row['upload_date']; $mp3 .= "<audio width='320' height='240' controls>n <source src='$file_url' type='audio/mpeg'>n </audio>n"; echo "$mp3"; }

 

i only have 4 mp3 files in the DB, but wheni run this code it shows me 10 different mp3 files, i have checked the file source, and the print_r, but there is nothing wrong, i think, it just stands that some of my mp3 are being duplicated, why?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...