song.phps
#!/usr/bin/php
<?
error_reporting(E_WARN);
mysql_connect(':/var/run/mysqld/mysqld.sock','erik','fisk');
mysql_select_db('songs') or error_log(mysql_error());
$playing = join('',mysql_fetch_row(mysql_query('select playing from users where user = "hellfairy"')));
if($playing != 1)
{
exit();
}
$info = mysql_fetch_assoc(mysql_query('select * from songs where user = "hellfairy" order by id desc limit 1'));
foreach(array_keys($info) as $key)
{
$info[$key] = stripslashes($info[$key]);
}
echo "np: $info[artist] - $info[title] ($info[length]/$info[quality]kbps/$info[genre])";
?>