Quantcast
Channel: DataTables 1.9 — DataTables forums
Viewing all articles
Browse latest Browse all 1816

[SOLVED] Getting data for the datatables using WHERE statement then still allow filtering

$
0
0
Hi all,

I am new to DataTables and I am trying to get some data to display. I want to only select data from the db WHERE field_name IS NOT NULL then be able to filter the results. How do I go about doing this. I have searched and searched but not found anything too helpful. By the way I am a noob so expect stupid questions! haha!

I have added the code below to the processing file:

$sWhereNew = "field_name IS NOT NULL ";

/*
* SQL queries
* Get data to display
*/
$sQuery = "
SELECT SQL_CALC_FOUND_ROWS `".str_replace(" , ", " ", implode("`, `", $aColumns))."`
FROM $sTable
WHERE $sWhereNew
$sWhere
$sOrder
$sLimit

This filters the results and shows at the bottom xxxx results filtered from xxxx but then I cannot use the search bar to filter further. What am I doing wrong?!

Thanks for any help!!

Viewing all articles
Browse latest Browse all 1816

Latest Images

Trending Articles



Latest Images