how to filter table when data is from MySQL data base connection
how to filter table when data is from MySQL data base connection
Dhrupad
Posts: 5Questions: 1Answers: 0
how to filter table when data is from MySQL data base connection. I tried the method shown in https://datatables.net/examples/api/multi_filter.html
but it is using only the first line for searching.
Answers
Please describe this problem in more detail. Better would be a link to your page or a test case replicating the issue so we can help debug.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
Please find the above Screenshot for the code used.
the below screen shot shows the result in the webpage.
even though a number containing 86 is present in the 1st column's 3rd row the search is comparing only the 1st row and giving "No matching records found" message
The information element at the bottom left has
(filtered from 1 total entries)
. That suggests you initialized Datatables with one row of data then after initialization added more rows using the above script. Datatables doesn't know about these additional rows. See this FAQ for more details and options.Kevin
..
https://jsbin.com/suqitewicu/edit?html
please find the full code here. Feel free to Correct it. I am still a beginner.
That's the issue. Move the
tbody
outside of thewhite
loop. You should only have onetbody
for a DataTable.Allan
Already tried it but still the same problem.
https://jsbin.com/gaxajunaji/edit?html
You've still got the closing
</tbody>
inside the while loop, so I suspect the browser is inferring an extra opening<tbody>
since at the moment it will be invalid HTML.Allan