Location: PHPKode > projects > Tetravex oggserv > oggserv/q.php
<?
//tetravex oggserv:oggbox by edd barrett
//http://www.sourceforge.net/projects/oggserv
//hide@address.com

$mode=$_GET['mode'];

include "header.php";


if ($mode=="history"){
	echo "<center><b>The playlist History</b></center>";
} else {
	echo "<center><b>COMING UP<center></b>";
}

include "back/conf.php";
$getcount="SELECT playlist_progress FROM oggserv_main";
$result=mysql_query($getcount,$link);
$row=mysql_fetch_array($result);
$current=$row['playlist_progress'];

if (!$mode){
	$sql="SELECT * FROM oggserv_playlist WHERE play_id>$current";
} 

if($mode=="history"){
	$sql="SELECT * FROM oggserv_playlist WHERE play_id<$current";
}

$list=mysql_query($sql,$link);

if(mysql_num_rows($list)==0){
	echo "<center>No Tracks<center>";
	include "footer.php";
	exit;
} 

$output="<table width=\"100%\"><tr><td><b>Track Name</b></td><td><b>Artist</b></td><td><b>Album</b></td><td><b>Duration</b></td><td><b>Who?</b></td></tr>";


while($row2=mysql_fetch_array($list)){
	$media_id=$row2['media_id'];
	$user=$row2['user'];
	
	$lookup="SELECT * FROM oggserv_media WHERE media_id=$media_id";
	$details=mysql_query($lookup,$link);
	$row3=mysql_fetch_array($details);
	$artist=$row3['artist'];
	$track_name=$row3['track_name'];
	$album_name=$row3['album_name'];
	$duration=$row3['duration'];
	
	$output.="<tr><td>$track_name</td><td>$artist</td><td>$album_name</td><td>$duration</td><td>$user</td><br>";

}
$output.="</table>";
echo $output;

include "footer.php";

?>
Return current item: Tetravex oggserv