I'm a php novice so be kind.... Have to sort date, after location continues to be selected.

    <div id="enroll_now">
  <form name="enroll" id="enroll" method="post" action="<?php echo get_permalink(762); ?>">
    <p>
      <label >Class Title</label>
      <input type="text" name="class_title" value="<?php echo $title;?>">
      </input>
    </p>
    <p>
      <label>Choose Location</label>
      <select name="location" id="location" >
        <option selected="selected" value="0">--Select Location--</option>
        <?php
        $result = mysql_query("SELECT * from wp_location WHERE class_id=$page_id ORDER BY location ASC");
        while($row = mysql_fetch_array($result))
        {
            echo "<option value=".$row['id'].">".$row['location']."</option>";

        }

    ?>
      </select>
    </p>
    <p>
      <label>Choose Date</label>
      <select name="choose_date" id="choose_date">
        <?php
        if (isset($datesavailable) && is_array($datesavailable)) {
        foreach($datesavailable as $val)
        {

        echo' <option value="'.$val.'">'.$val.'</option>\n';
 }
 }
    ?>
      </select>
    </p>
    <p>
      <input type="image" src="<?php bloginfo('template_url'); ?>/images/confirm.png" alt="Confirm Information" />
    </p>
  </form>
</div>

The locations sorts fine, however after i arrive at the date, I want these to sort by nearest date first. Any help could be appricated. Thanks.

I examined your page and find out that you are delivering a Publish (id &lifier location) once the event change is triggered inside your combo. My suggestion would be to query the database such as this

SELECT * from wp_location WHERE class_id=$_POST['id'] AND location=$_POST['location'] ORDER BY date

I am presuming date area inside your database is DATE, DATETIME or TIMESTAMP type.

Use ORDER BY somecolumn inside your query http://dev.mysql.com/doc/refman/5.0/en/order-by-optimization.html

When the dates are simply an assortment, you should use asort or arsort.

http://php.net/manual/en/function.asort.php