Server side version of $.fn.dataTable.ext.search
Server side version of $.fn.dataTable.ext.search
Hi!
Is there any server side version of $.fn.dataTable.ext.search?
I have my datatable behind a login page and only want to show rows that been created by the end user that is logged in. I have a column with "creater_id" on each row to know which row that belongs to what user. I assume I can use $.fn.dataTable.ext.search to filter results to only match the user id before end user can serach or see any results. But is there any server side version of that? I assume that would be safer then to set a filter on client side.
Answers
Apply an additional WHERE condition whatever server-side script you are using.
Allan
Thanks Allan! I´m using php and mysql and have installed the file structure from your generator. So I assume the extra WHERE condition should be added in the file called "Query.php" and by changing the following code block:
But I have to admit I probably missunderstand something fundemental here. I don´t understand how or where to manipulate the $key and $value variables? Lets´s say $key = "creator" and the $value = $_SESSION['logedinuser'], where do I set this?
Ah! If you are using Editor's PHP libraries, then have a look at the documentation here. That is how you would apply conditions such as the ones you are looking for.
Allan