[thelist] PHP/PostgreSQL

Daniel J. Cody djc at starkmedia.com
Sat Jan 13 18:42:31 CST 2001


How about something like this:

Create the table in the DB that has the fields you mentioned, plus an 
extra one called something like 'file path':

SQL> desc users
  Name                                      Null?    Type
  ----------------------------------------- -------- -------
  ARTIST                                    NOT NULL VARCHAR2(100)
  GENRE                                       NOT NULL VARCHAR2(50)
  SONG_NAME                                     NOT NULL VARCHAR2(100)
  FILE_PATH                                NOT NULL VARCHAR2(100)

for example..

Then when you pull up the song you want to hear either by search or 
whatever, the php page would show display that info however you wanted.. 
the trick would be to have a link around the song name with the filepath 
info around it like so:

<a href="file:///F:\music\mp3s\beegees\you_should_be_dancing.mp3">You 
Should Be Dancing</a> by the Bee Gee's.

So that when you clicked on the link, it would open up whatever you have 
associated with the .mp3 extension, like WinAmp and you're groovin to 
the Bee Gee's :)

This assumes that you have a list of where each file sits on your hard 
drive or mapped network drive. There are a hundred utilities that will 
do it for you on download.com

Basically, when you input the info like artist and song name into the 
DB, insert some information in there as well about where the file is. 
Then use 'file:///' in your <a> tag to link to it.

Hopefully that helps you out, shout if you have any more questions. :)


Jay Fitzgerald wrote:

> I have an idea for a project I want to try; here's the scenario:
> I have approximately 6,400 mp3 files...what I am thinking of doing is
> making an SQL database which contains all the the song titles along with
> artist and possibly genre to which they belong...then have a PHP file
> that would allow you to view all songs by title, artist or genre;; but
> would also allow you to search for a specific song...when the results
> are displayed, the visitor to the page could click on the song they want
> and it would play right from the web or execute their default mp3
> player...
> I know it will be extremely tedious and nerveracking - but IS it
> possible? if not - fine; but if it is possible, does anyone have ideas
> for where I should begin and how I can execute an external program via
> this type of interface.

More information about the thelist mailing list