PDGA Disc Golf Course Details

//require_once('course/course_details.inc.php');

$id = $_GET['id'];
$query = 'SELECT c.nid FROM vb_drupal_content_type_course c LEFT JOIN vb_drupal_node n ON n.nid = c.nid WHERE c.field_course_id_value='.$id.' AND n.status =1 ORDER BY c.nid DESC LIMIT 1';

$result = db_query($query);
while ($node = db_fetch_object($result)) {
$path = 'node/'.$node->nid;
drupal_goto($path);
}

?>