title: PHP, MYSQL, HTML table with tablesorter
body: <p>Trying to add <a href="http://tablesorter.com/docs/" rel="nofollow">tablesorter</a> added to a page I am creating.  I know very little of jquery, so I'm guessing that's where my fault is.  I've added the required code in the <code>&lt;head&gt;</code> area of my page, and made the necessary changes to my table.  My table still renders as it would with just HTML.  Ideas?</p>
  
  <pre><code>&lt;html&gt;
   &lt;head&gt;
    &lt;title&gt;Inventory&lt;/title&gt;
     &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"&gt;&lt;/script&gt;
     &lt;script type="text/javascript" src="http://tablesorter.com/__jquery.tablesorter.min.js"&gt;&lt;/script&gt;
     &lt;script type="text/javascript"&gt;
       $(document).ready(function(){ $("table").tablesorter(); });
     &lt;/script&gt;
   &lt;/head&gt;
   &lt;body&gt;
  &lt;?php
  $con=mysqli_connect("localhost","user","pass","db_name");
  if (mysqli_connect_errno())
    {
    echo "Failed to connect to MySQL: " . mysqli_connect_error();
    }
  
  
  $query = "SELECT 
              products.name,
              products.sku,
              inventory.quantityfry,
              inventory.quantityjuv,
              inventory.quantityadult,
              inventory.notes,
              inventory.location,
              inventory.owner
            FROM 
              products
            INNER JOIN 
              inventory
            ON
              products.sku=inventory.sku";
  
  $result = mysqli_query($con,$query) or die(mysqli_error($con));
  echo "&lt;table border='1' id='table' class='tablesorter'&gt;
  &lt;thead&gt;
  &lt;tr&gt;
  &lt;th&gt;Species&lt;/th&gt;
  &lt;th&gt;SKU&lt;/th&gt;
  &lt;th&gt;Fry Count&lt;/th&gt;
  &lt;th&gt;Juvie Count&lt;/th&gt;
  &lt;th&gt;Adult Count&lt;/th&gt;
  &lt;th&gt;Notes&lt;/th&gt;
  &lt;th&gt;Location&lt;/th&gt;
  &lt;th&gt;Owner&lt;/th&gt;
  
  &lt;/tr&gt;
  &lt;/thead&gt;";
  
  while ($row = mysqli_fetch_assoc($result)) {
      echo "&lt;tbody&gt;";
      echo "&lt;tr&gt;";
      echo "&lt;td&gt;" . $row['name'] . "&lt;/td&gt;";
      echo "&lt;td&gt;" . $row['sku'] . "&lt;/td&gt;";
      echo "&lt;td&gt;" . $row['quantityfry'] . "&lt;/td&gt;";
      echo "&lt;td&gt;" . $row['quantityjuv'] . "&lt;/td&gt;";
      echo "&lt;td&gt;" . $row['quantityadult'] . "&lt;/td&gt;";
      echo "&lt;td&gt;" . $row['notes'] . "&lt;/td&gt;";
      echo "&lt;td&gt;" . $row['location'] . "&lt;/td&gt;";
      echo "&lt;td&gt;" . $row['owner'] . "&lt;/td&gt;";
      echo "&lt;/tr&gt;";
      echo "&lt;/tbody&gt;";    
  }
  
  mysqli_free_result($result);
  
  echo "&lt;/table&gt;";
  
  mysqli_close($con);
  ?&gt;     
   &lt;/body&gt;
  
  
  
  &lt;/html&gt;
  </code></pre>
  
  <p>Thanks!</p>