I am trying to display certain MySQL data based off of what link is clicked. For example.. I want to display all the entries from 2009 when a link for 2009 is clicked; maybe like..
<a href="http://website.com/page?yr=09">2009</a>
But I am having trouble doing so.. any help would be great!
P.S. The years are in my database with only the last two numbers.. 10, 09, 08, etc.
$result = mysql_query("select setlist_id, month, day, year, name, venue, location, label1, set1, set2, set3, encore, notes, photos, recording, poster
from $database_table order by setlist_id DESC, year, month, day",$db)
or die_now("Could not select setlists");
while($row = mysql_fetch_array($result)) {
$the_id = $row["setlist_id"];
$the_month = $row["month"];
$the_day = $row["day"];
$the_year = $row["year"];
$the_name = $row["name"];
$the_venue = $row["venue"];
$the_location = $row["location"];
$the_label1 = $row["label1"];
$the_set1 = $row["set1"];
$the_set2 = $row["set2"];
$the_set3 = $row["set3"];
$the_encore = $row["encore"];
$the_notes = $row["notes"];
$the_photos = $row["photos"];
$the_recording = $row["recording"];
$the_poster = $row["poster"];
echo("<div class='date' id='date' tabindex='0'>" . "$the_month" . "." . "$the_day" . "." . "$the_year" . " - ");
echo ($the_name != '') ? "" . "$the_name" . " - " : '';
echo("" . "$the_venue" . " - " . "$the_location" . "</div>");
echo("<div class='set'>" . "$the_label1" . ":<br /></div><div class='list'>" . "$the_set1" . "<br /></div>");
echo ($the_set2 != '') ? "<div class='set'>Set Two:<br /></div><div class='list'>" . "$the_set2" . "<br /></div>" : '';
echo ($the_set3 != '') ? "<div class='set'>Set Three:<br /></div><div class='list'>" . "$the_set3" . "<br /></div>" : '';
echo ($the_encore != '') ? "<div class='set'>Encore:<br /></div><div class='list'>" . "$the_encore" . "<br /></sdiv>" : '';
echo("<div class='line'></div>");
echo nl2br("<div class='notes'>" . "$the_notes" . "</div>");
}
When I replace the $result line with...
$result = mysql_query("SELECT * FROM `$database_table` WHERE `year` = '09' order by setlist_id DESC, year, month, day",$db)
or die_now("Could not select shows");
... I get all the results from just 2009, which is what I want, but I want the results to depend on what link has been clicked. I hope I am making sense.