Jquery pass wrong value to page
<p>I have been struggling with this for days. This works, but does not pass the correct variable to the page ( testMap.php ). I use data from my DB and hovering over the link does show the correct variables in the URL, but for whatever reason jquery is always grabbing the first variable in the loop. Any suggestions?</p>

<pre><code>&lt;?php
    $myname = $_SESSION['username'];
    global $database;
    $stmt = $database-&gt;connection-&gt;query("SELECT * FROM ".TBL_FLIGHTS." WHERE username='$myname'");

        while ($row = $stmt-&gt;fetch(PDO::FETCH_ASSOC)){
            $date       = $row['date'];
                    $starting   = $row['starting'];
                    $ending     = $row['ending'];
                    $route      = $row['route'];
                  echo "&lt;a class=\"route\" href=\"start=$starting&amp;end=$ending\"&gt;&lt;p class=\"pBlue\"&gt;$date - $starting - $ending - $route&lt;/p&gt;&lt;/a&gt;";
                  ?&gt;
        &lt;div id="start" style="visibility:hidden"&gt;&lt;?php echo $starting; ?&gt;&lt;/div&gt;
        &lt;div id="end" style="visibility:hidden"&gt;&lt;?php echo $ending; ?&gt;&lt;/div&gt;
        &lt;?
    }

    ?&gt;


&lt;script type="text/javascript"&gt;
$(document).ready(function() {
    var start = $('#start').text();
    var end = $('#end').text();

    $(function() {
      $(".route").click(function(evt) {
         $("#mymap_canvas").load("testMap.php?start="+start+"&amp;end="+end )
         evt.preventDefault();
      })
    })

});
&lt;/script&gt;
</code></pre>
