title: parsing table rows with jquery
body: <p>I'm trying to parse an html table and use the column values to form a mysql query.  I'm trying to test to see if my variables are working correctly, but I'm not getting the first alert to pop up.  I know that the function is executing because the second alert displays, but I don't know what is wrong with my variables.</p>
  
  <p>Also, how do I get the selected value from the select box?</p>
  
  <p>Here is my function:</p>
  
  <pre><code>function rows()
  {
      $("#ingredients tr").each(function() {
              var ingr= $(this).find("td").eq(2).html();
              var prep= $(this).find("td").eq(3).html();
              var quant= $(this).find("td").eq(4).html();
              alert(prep);
      });
      alert("something");
  }
  </code></pre>
  
  <p>Here is my table:</p>
  
  <pre><code>&lt;TABLE name="ingredients" id="dataTable" width="350px" align="center" border="0"&gt;
  &lt;TR&gt;
  &lt;td&gt;&lt;/td&gt;
  &lt;td&gt;Ingredient&lt;/td&gt;
  &lt;td&gt;Preparation&lt;/td&gt;
  &lt;td&gt;Amount&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;&lt;input type="checkbox" name="chk"/&gt;&lt;/td&gt;
  &lt;TD&gt;
  &lt;SELECT name="ingredient"&gt;
  &lt;?php
  $db = new mysqli('localhost','root','mellon','recipes');
  if($db-&gt;connect_errno &gt;0){
      die('Unable to connect to database [' . $db-&gt;connect_error . ']');
  }
  
  $query="select * from ingredients;";
  if(!$results= $db-&gt;query($query)){
      die('There was an error running the query [' . $db-&gt;error . ']');
  }
  
  while($row = $results-&gt;fetch_assoc()){
      echo "&lt;option value=\'" . $row['name'] . "&gt;" . $row['name'] . " (" . $row['units'] . ")" . "&lt;/option&gt;";
  }
  $results-&gt;free();
  $db-&gt;close();
  
  ?&gt;
  &lt;/SELECT&gt;
  &lt;/TD&gt;
  &lt;TD&gt;&lt;INPUT type="text" name="prep"/&gt;&lt;/TD&gt;
  &lt;TD&gt;&lt;INPUT type="text" name="quantity"/&gt;&lt;/TD&gt;
  &lt;/TR&gt;
  &lt;/TABLE&gt;
  </code></pre>