I am having a problem where I have one page with 3 drop down menus that submits the form to itself. When I submit the "venue" input, the query within the "venue" if clause works perfectly. However, when I submit the "gig" clause the query will absolutely not run. I have troubleshot this thing to death. All of the queries work perfectly in MySQL, upon submission of the "gig" variable, I am able to access the "gig" else if clause by echoing a simple statement, and I know that it's properly reading the "$_GET['gig']" variable. I have a feeling that it might someone be related to a quotes issue in $query, but I cannot seem to figure it out. Here's the code...I've only included the if submitted clauses...if you need more code just ask, but I'm pretty sure that the issue is somewhere here:
if(isset($_GET['venue'])){
$query = "SELECT setlist_number, track FROM setlist, venue, gig, track
WHERE setlist.venue_id = {$_GET['venue']}
AND setlist.gig_id = gig.gig_id
AND setlist.venue_id = venue.venue_id
AND setlist.track_id = track.track_id";
$result = mysql_query($query);
$page_title = 'X';
include ('includes/header.html');
while($row = mysql_fetch_array($result)) {
echo '<p>'.$row['setlist_number'].'---'.$row['track'].'<p/><br/>';
}
mysql_free_result($result);
} else if (isset($_GET['year'])) {
$query = "SELECT DATE_FORMAT (gig_date, '%M') AS gig_month, DATE_FORMAT (gig_date, '%d') AS gig_day, DATE_FORMAT (gig_date, '%Y') AS gig_year,
CONCAT(venue, ', ', city, ', ', country) AS vcc
FROM setlist, venue, gig";
$result = mysql_query($query);
$num = mysql_num_rows($num);
$page_title = 'x';
include ('includes/header.html');
echo $num;
} else if (isset($_GET['gig'])) {
$query = "SELECT setlist_number, track, venue.venue, DATE_FORMAT (gig_date, '%M %d, %Y') AS gd,
CONCAT(venue, ', ', city, ', ', country) AS vcc
FROM setlist, venue, gig, track
WHERE setlist.gig_id = {$_GET['gig']}
AND setlist.gig_id = gig.gig_id
AND setlist.venue_id = venue.venue_id
AND setlist.track_id = track.track_id";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
$page_title = $row['vcc'];
include ('includes/header.html');
echo "<p>".$row['track']."<p>";
} else {
//form is in this clause
}
Thank you for the help!!!