Add search results to a PHP array?

Add search results to a PHP array?

bsukbsuk Posts: 92Questions: 26Answers: 2

Is this possible (using server side processing)?
I need to find the best way to somehow copy search results (from a client DT search) into an array, or some other form of saved data on the server.
For example, if my datatables search returned 10 people, to somehow capture that result into a file/array/string/DB entry on the server, based on the client search result. Is this possible with a plugin or other?
Currently I'm using tabletools to capture into a CSV, then copying and pasting results..

Thanks!

Answers

  • ignignoktignignokt Posts: 146Questions: 4Answers: 39

    If you are using the ssp.class.php file it looks like you could do something like this.

    /*
    * Output
    */
    $data = self::data_output( $columns, $data );
    if($recordsFiltered < $recordsTotal){
        //insert the $data array into your DB
    }
    return array(
        "draw"            => intval( $request['draw'] ),
        "recordsTotal"    => intval( $recordsTotal ),
        "recordsFiltered" => intval( $recordsFiltered ),
        "data"            => $data
    );
    
  • bsukbsuk Posts: 92Questions: 26Answers: 2

    Thanks for the advice! I'll check that out. I'm currently just using the demo PHP file for my server side processing. I need to investigate ssp.class.php in more detail.

    Hopefully a button/Jquery action can be added, much like tabletools but to capture the results on the server side.

This discussion has been closed.