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

IjesunIjesun Posts: 18Questions: 2Answers: 0
edited May 2023 in Free community support

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

  • kthorngrenkthorngren Posts: 21,341Questions: 26Answers: 4,954

    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

  • IjesunIjesun Posts: 18Questions: 2Answers: 0

    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?

  • kthorngrenkthorngren Posts: 21,341Questions: 26Answers: 4,954

    I would start by posting your serverside code so we can take a look at what you have.

    fails to work.

    Please provide more specifics of how it doesn't work. Do you see error messages?

    Kevin

Sign In or Register to comment.