Hi all . I wonder how i can join playlist table and files table so for each Rec_ID in playlist table i get corrspondent artist,title,album and ID from files table.(bold parts) My current query only produces IDs in a perticuler playlist .
SELECT * FROM playlist WHERE playlistname='$playlistname'
But i be happy if some one show me how i can produce artist,title,album and ID for each songs in playlist table by passing the query the playlistname. Thanks
Note ID in files table are the same as Rec_ID in playlist table.
files:
ID, filename, artist, title, album, track
playlist:
User_ID ,Rec_ID ,playlistname
playlists:
playlistname, User_ID. songsno
SELECT * FROM playlist WHERE playlistname='$playlistname'
But i be happy if some one show me how i can produce artist,title,album and ID for each songs in playlist table by passing the query the playlistname. Thanks
Note ID in files table are the same as Rec_ID in playlist table.
files:
ID, filename, artist, title, album, track
playlist:
User_ID ,Rec_ID ,playlistname
playlists:
playlistname, User_ID. songsno
Code:
<?php
$playlistname = $HTTP_GET_VARS['playlistname'];
$user = "root";
$pw = "";
$db = "test2";
$mysql_access = mysql_connect("localhost", $user, $pw);
mysql_select_db($db, $mysql_access);
[B]$query = "SELECT * FROM playlist WHERE playlistname='$playlistname'";[/B]
$result = mysql_query($query);
?>
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<title>Untitled </title>
</head>
<body>
<table width="95%" id="table1" bordercolorlight="#008ED2" style="border-style: dashed">
<form action="/members/ViewPlayList.asp" method=post >
<input name="go" type="hidden" value="yes">
<input name="list" type="hidden" value="2205">
<tr>
<td width="5%"> </td>
<td width="30%"><b>Song Name</b></td>
<td width="30%"><b>Singer - > Album</b></td>
<td width="10%"><b>Rate It</b></td>
<td width="5%"><b>Hits</b></td>
</tr>
<?
while($row = mysql_fetch_assoc($result))
{
?>
<tr bgcolor="#C0C0C0">
<td width="3%"><input type="checkbox" name="id" value=" [B]<?=intval( $row['Rec_ID'] );?>[/B] "></td>
<td width="30%"><a href="javascript:newWindow('../player/player.asp?id=<?=intval( $row['Rec_ID'] );?>')">[B]Title[/B]</a></b> </td>
<td width="30%"><a href="../Albums.asp?singerID=1380">[B]Artist[/B]</a> -
<a href="../AlbumSongs.asp?AlbumId=1729&Album=Siya Mo&Singer=Ahmad Sha&SingerID=1380">
[B]Album[/B]
</a>
</td>
<td width="10%"><a href="javascript:newWindow('../RateSong.asp?SongID=28484')"><img border="0" src="[URL unfurl="true"]http://www.afghanmtv.com/images/RatIt.gif"[/URL] width="90" height="24" longdesc="Rate This Song" alt="Rate This Song"></a> </td>
<td width="5%">98 </td>
</tr>
<?
}
?>