title: jQuery + PHP getting AJAX data
body: <p>Whats the best way to pass data to jQuery AJAX Get method via PHP. And then constructing a query based of that which can be loaded into something via AJAX and displayed on the page.</p>
  
  <p>ex: by clicking viewer.php?note_id=2 a modular window would show and AJAX would get all data in regards to note_id 2 from viewer.php with out going to viewer.php directly. </p>
  
  <p>The problem is that I will be most likely using a list of this notes on the page and are all separated by LI tags.</p>
  
  <p>So what would be the best way to go around this? And assure the correct note_id is passed for the notes from the href link?</p>
  
  <p>PHP code that selects everything for DB will need to fix this since it seems not to follow DESC as well as LIMIT 12 syntaxes</p>
  
  <pre><code>    $q_ASL32 = mysql_query("SELECT * FROM notice ORDER BY nid DESC LIMIT 12");
     $r_ASL32 = mysql_fetch_array($q_ASL32);
  
     $nid = $r_ASL32['nid'];
     $note = $r_ASL32['note'];
     $type = $r_ASL32['type'];
     $private = $r_ASL32['private'];
     $date = $r_ASL32['date'];
     $author = $r_ASL32['author'];
  </code></pre>
  
  <p>part 2 of the same PHP code to create notes list from MySQL data</p>
  
  <pre><code> echo '
     &lt;li&gt;
     &lt;p&gt;
     &lt;a href="viewer.php?nid='.$nid.'" id="record-'.$nid.'"&gt;
     &lt;img src="16x16/apps/2439.png" /&gt;
     &amp;nbsp;
     '.$author.', '.note_type($type).'
     &lt;/a&gt;
     &lt;/p&gt;
     &lt;/li&gt;
     ';
  </code></pre>
  
  <p>jQuery AJAX Part</p>
  
  <pre><code>$.ajax({
                     type: "GET",
                     url: "vierw.php",
                     async: false,
                     data: "ajax=1&amp;nid=' + parent.attr('id').replace('record-',''),
                     success: function(html){
                          $("#note_utm").html(html);
                          $(".loader").html("");
                     }
          });
  </code></pre>
  
  <p>I seem to be getting screwed over by data function in the AJAX call so I think my AJAX call is incorrect</p>