Hi Guys,
Having some trouble joining two tables. The script below works fine, except that it retrieves all band_name from the bands table. I have another table named gig which also has the band_id associated with it. What i want to do is join the two tables (bands abd gig) and only display the band_name of those bands that actually have data in the gig table.
<?
$link = mysql_connect('localhost', 'username', 'password');
mysql_select_db('typhoon');
$query = "SELECT band_id, band_name FROM bands";
$result = mysql_query($query);
while($row = mysql_fetch_array($result)){
//echo "<img height=\"11\" src=\"pics/arrow_right.gif\" width=\"6\" >\n";
echo "<img height=\"13\" src=\"images/magnify.gif\" width=\"13\" > <a href=\"http://www.typhoon-ent.com.au/edit_gig.php?id={$row['band_id']}\"><font color=\"red\">{$row['band_name']}</font></a><br>\n";
}
?>
Any ideas, or is there a better way of doing this?
Cheers,
micmac