Datatables error when searching or sorting specific columns
Datatables error when searching or sorting specific columns
amosangyj
Posts: 5Questions: 2Answers: 0
Hello,
I encountered this strange issue where I am unable to perform a search on my table but am able to sort only specific columns. The error that appears is Invalid argument supplied for foreach() and what is returned is {"draw":null,"recordsTotal":null,"recordsFiltered":null,"data":[]}. I have 1 entry that loads fine when I reload the page though.
I have this debug uploaded here https://debug.datatables.net/acarad
Please let me know if you need more information
This discussion has been closed.
Answers
That error is obviously in your own PHP file. "foreach()" expects an array, but is not being supplied with one.
But the page loads fine and some columns can be sorted. When I type in the name of the item that is shown on the table and search, this error occurs