jQuery Table Search filter on a PHP generated table
I have a MySQL table with less than a thousand rows and it's fetched by a
PHP script. I would like to be able to sort the tbody by ASC or DESC order
when clicking a link and still be able to use the search bar like in the
this demo here. However when I try to incorporate the coding in my PHP
generated table, my search bar doesn't filter. I must be doing something
wrong.
Here's my PHP script:
$result = mysql_query("SELECT * FROM table_name");
while ($row = mysql_fetch_array($result)) {
echo "<tr>";
echo "<td>" . $row['fruits'] . "</td>";
echo "<td>" . $row['colors'] . "</td>";
echo "</tr>";
}
mysql_close();
If possible I'd like to have some hint, snippet or even examples would be
great!
Thanks
No comments:
Post a Comment