Jump to content

Creating .m3u files dynamically


PC Nerd

Recommended Posts

Hi,

 

Im looking at creating a playlist program for my server.  i have alist of files within my database, and i wanted to be able to place these values into a playlist file.  the problem is that i dont know how to get the database to create the playlist form its records.  ie, if i uploaded a new file to my server and into the database, then i woudl want the script to automatically grab that file ( SQL  i know), anbd the nplace it in the m3u file ( i dont know).

 

Coudl someone recommend a simple method to complete this?  or point me in teh righ t doirection for a tutorial?

 

thanks

Link to comment
Share on other sites

i built a script to stream mp3 sermon podcasts for a church.

 

<?php
include('conection_info.php'); //file with mysql connection info
$query = mysql_query("SELECT * FROM sermons WHERE id='$_GET[id]'");
$row = mysql_fetch_array($query);

//update download count to track how many times this sermon has been played -obviously optional
mysql_query("UPDATE sermons SET mp3plays = mp3plays + 1 WHERE id = '$_GET[id]' ");

header("Content-type: audio/m3u");
header("Content-Disposition: inline; filename=".$_GET['id'].".m3u");
?>
http://www.ourwebsite.org/<?php echo $row['mp3Location']; ?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.