Shoutbox

import name from mysql database - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Forum: Plug-Ins (/forumdisplay.php?fid=28)
+------ Thread: import name from mysql database (/showthread.php?tid=70692)

import name from mysql database by rvec on 01-14-2007 at 09:34 PM

I use sam to stream my Internet radio. This program exports the song playing to a mysql database. I want to show the current playing song with some own text as my screen name.

example:
song playing: Yellow Submarine - The Beatles
my screenname: Now on my radio: Yellow Submarine - The Beatles

the things the script should do:
log into mysql
goto a database (samdb is the standard)
browse table historylist
find the input with the highest ID
echo artist and title in screenname

The Fieldnames are "ID" "artist" and "title"
ID is the primary key

If any more information is needed don't hesitate asking.
I can also give a sample database.



Edit: The thing above gives the last played song if none is playing. So you also need to do "total playtime last song + last played > time now"

Flieldname last played="date_played"
date_played in this format:"2007-01-15 14:28:17"
Fieldname total playtime= "duration"
duration in this format: "164284" (time in seconds)