Hi
I’m wondering if this can be done, and if so how do I go about doing it
I’ve 50 fields in a MYSQL database and displaying in a table on a browser, there’s quite a bit of data in the table, and the user wants to be able to filter each field on the browser, just like in excel, can this be done for 50 fields using PHP? and if so any tips on how id get it started
I recommend NOT putting the filter as the sole element in the th tag as Anthony has done. People who are blind use the table headings to navigate the table. Instead of knowing “in this colum are people’s names”, they get a drop down.
That would be a horrendous page IMO.
Just build a drop down, build the options off that column, tthen have a button that runs a new query based off the select…
<select>
<?php
$sql = 'select distinct name from tbl';
$result = $mysqli-> query($sql);
while($row=$result->fetch_assoc();){
echo '<option value="'.$row['name'].'">'.$row['name'].'</option>';
}?>
</select>
the user would click on the filter and select from the drop-down list
this list would be everything that would be in that column, and there would be 50 columns of data, with 50 filters