How do you only display results that do not have NULL values in a specified column?
How do you only display results that do not have NULL values in a specified column?
erbanach
Posts: 18Questions: 5Answers: 0
Hi there,
I have a question about PHP server-side processing with DataTables. Currently, I have the following columns being pulled in from the mySQL database:
$columns = array(
array( 'db' => 'Client', 'dt' => 0 ),
array( 'db' => 'EstimateNumber', 'dt' => 1 ),
array( 'db' => 'Status', 'dt' => 2 ),
array( 'db' => 'CurrentEstimateTotal', 'dt' => 3 ),
array( 'db' => 'CreatedDate', 'dt' => 4 )
);
I want to include code here that only displays results that do not have a NULL value in the CreatedDate column. Is there an easy way to do this? Thank you for your help!
This question has accepted answers - jump to:
This discussion has been closed.
Answers
This is with the demo
SSP
class is it? You would need to use theSSP::complex()
method which allows you to specify a WHERE filter by passing in optional parameters. There are documentation comments for those parameters in the SSP class.Allan
Hi Allan,
Is this the correct function? What else do I need to add?
Thank you,
Liz
Yes - that's the one. So basically what you might do is:
That will basically add
WHERE myColumn IS NOT NULL
to the SQL query (obviously update the column name as required .Regards,
Allan
Worked like a charm! Thank you!