Why is datatables returing all data from database table yet I have used serverside sorting before
Why is datatables returing all data from database table yet I have used serverside sorting before
Ijesun
Posts: 18Questions: 2Answers: 0
I am using datatables to display data from the database. I am fetching data according to a STATUS row in the database table but the datatables is fetching all data without taking into account the query (WHERE status =?). Please can you help explain how I can make it fetch only the rows that have the STATUS value that I have stated in the PHP query?
When I use a normal html table without datatables the data is fetched according to the status as I have stated in the PHP query
Answers
Are you asking how to send parameters via ajax for the where clause? If so use
ajax.data
as a function like this example.Kevin
Please not that. When I add search functionality from the serverside using AND and OR clauses, my WHERE clause from the original query before searching, fails to work. Please what is the remedy?
I would start by posting your serverside code so we can take a look at what you have.
Please provide more specifics of how it doesn't work. Do you see error messages?
Kevin