$userID = 0; if (isset($_COOKIE['userID'])) { $userID = $_COOKIE['userID']; } else { header("Location: /tick/login.html"); } $stageID = 0; if (isset($_COOKIE['stageID'])) { $stageID = $_COOKIE['stageID']; } else { header("Location: /tick/stages.php"); } $query = "SELECT events.name as event_name, stages.* FROM events, stages WHERE events.ID = stages.eventID AND stages.ID = $stageID AND events.userID = $userID"; $result = mysql_query($query, $db); if ($result) { while ($r = mysql_fetch_array($result)) { $event_name = $r['event_name']; $name = $r['name']; $standings_gc = $r['standings_gc']; $standings_now = $r['standings_now']; $standings_gc_url = $r['standings_gc_url']; $standings_now_url = $r['standings_now_url']; $standings_gc_header = $r['standings_gc_header']; $standings_now_header = $r['standings_thru']; } mysql_free_result($result); } ?>