add super WHERE clause and problem with bSearchable

add super WHERE clause and problem with bSearchable

probaproba Posts: 6Questions: 0Answers: 0
edited December 2010 in General
I try to add WHERE clause form all showing rows and edit php file for server-side.

[code]
session_start();
...
/*
* Filtering
* NOTE this does not match the built-in DataTables filtering which does it
* word by word on any field. It's possible to do here, but concerned about efficiency
* on very large tables, and MySQL's regex functionality is very limited
*/
$user=$_SESSION['user_id'];
$sWhere = "WHERE ko='$user'";
if ( $_GET['sSearch'] != "" )
{
$sWhere = "WHERE (ko='$user' AND ";
for ( $i=0 ; $i

Replies

  • badeabadea Posts: 16Questions: 0Answers: 0
    Hi proba!

    I using the server-side (php + mysql) datatable and trying to add the where statement.
    Did you solve your post ?
  • UPEngineerUPEngineer Posts: 93Questions: 0Answers: 1
    Hello,

    I answered a similar post a while ago.

    Here is what I use in this scenario and it works very well.

    Here is my code:

    [code]
    $sWhere = "";
    if ( $_GET['sSearch'] != "" )
    {
    $sWhere = "WHERE (";
    for ( $i=0 ; $i
  • badeabadea Posts: 16Questions: 0Answers: 0
    Hi again UPEngineer !

    I also tryied and this code. It works but the same problem "search results" - i posted in another discusion.
This discussion has been closed.