Skip to content
Advertisement

Datatables Filter not working when applying SQL Server 2008 pagination code

I have managed to make the pagination work (thanks to @zhorov) but somehow it’s conflicting with the search/filter function.

Tried to put each query in each $_post to see if the select query will not conflict and when I put the first select query at the bottom it will override the query for pagination. When I put the pagination query on top it wont display anything.

Here is the complete code that I have

Both the Pagination and Filter/Serch should work.

Advertisement

Answer

It’s probably too late for this answer, but I think that next approach may help. You just need to put your WHERE clause in the subquery.

Notes:

This example is based on your code. Note, that although you use prepared statements ($connection->prepare($query)), it’s necessery to use parameters to prevent SQL injection, when you have user input.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement