Hi ya peepz,
Been trolling the net for hours trying to find a solution to my problem.
I am currently running a SHOUTcast server on my home PC and I have a SQL database installed so that all the tracks that are played are logged for future reference.
The problme I have is when no-one is connected, now and again the track title will get logged as blank and then the last track is logged again, so I start to get a bit of spam, you can see it here:
http://dz.game-host.org/radio/index.php
basically the page refreshes every 30 seconds and I am trying to get a bit of code that looks for a blank field in “songTitle” and then deletes that row automatically, I can do it manually but thats a pain as I want it to run maintainance free and this is the last problem I face (I hope!)
I have tried
[code]//mysql connection settings
$connection = mysql_connect($castithost,$castituser,$castitpass)
or die(“Couldn’t connect.”);
$db = mysql_select_db($castitdb,$connection) or die (“couldnt select database”);
//SQL Statement
$sql = 'SELECT * FROM ‘.$ctbl_prefix.‘songinfo ORDER BY time DESC limit 0,’.$sngs.’ ';
//Delete all rows that have blank track titles
$sqldel = 'DELETE * FROM '.$ctbl_prefix.'songinfo WHERE songTitle = “” ';
//Execute sql query and show results
$sql_result = mysql_query($sql,$connection,$sqldel) or die (“could not execute the query”);[/code]
Unfortunatly I’m no coder and its driving me insane, so I would appriciate any help that you could offer.
Thanks.
Edd