JQuery Table Sorter - PHP related -


apologies off if amateurish question. trying jquery tablesorter plugin work table generated php mysql database. @ moment i'm unable sorting work. i'm thinking sequence of javascript , php operating , may need implement callback in javascript or something. anyway code have is:

<html> <head> <script src="jquery/jquery.js" type="text/javascript"></script> <script src="jquery/jquery.tablesorter.min.js"></script>  <script type="text/javascript"> $(document).ready(function()      {          $("#table1").tablesorter({ sortlist: [0,0] });      }); </script> </head> <body>  <?php $con = mysql_connect("localhost","root","root"); if (!$con)   {   die('could not connect: ' . mysql_error());   }  mysql_select_db("database1", $con);  $result = mysql_query("select * playerstats1 g>2 limit 0,20");  echo "<table id=\"table1\" class=\"tablesorter\" border=1px> <caption align=top>stats</caption> <thead> <tr> <th width=90px>forename</th> <th width=90px>surname</th> <th width=50px>team</th> <th width=40px>g</th> <th width=50px>rpg</th> <th width=50px>apg</th> <th width=50px>topg</th> <th width=50px>bpg</th> <th width=50px>spg</th> <th width=50px>ppg</th> </tr> </thead>";  while($row = mysql_fetch_array($result))   {          echo "<tbody>";   echo "<tr>";   echo "<td>" . $row['forename'] . "</td>";   echo "<td>" . $row['surname'] . "</td>";   echo "<td align='center'>" . $row['team'] . "</td>";   echo "<td align='center'>" . $row['g'] . "</td>";   echo "<td class='col1' align='center'>" . $row['rpg'] . "</td>";   echo "<td class='col2' align='center'>" . $row['apg'] . "</td>";   echo "<td class='col3' align='center'>" . $row['topg'] . "</td>";   echo "<td class='col4' align='center'>" . $row['bpg'] . "</td>";   echo "<td class='col5' align='center'>" . $row['spg'] . "</td>";   echo "<td class='col6' align='center'><b>" . $row['ppg'] . "</b></td>";   echo "</tr>";   echo "</tbody>";   } echo "</table>";  mysql_close($con); ?>  </body> </html> 

if case of implementing call back- guidance/code appreciated.

has nothing sequence; browser executes javascript, , far it's concerned, php-generated html same html, fact it's generated irrelevant. suggest turn on debug mode in tablesorter , use firebug , see if illuminates issue, otherwise i'm not seeing, on surface, causing problem. not might not there, i'm missing it. :)


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -