CodeIgniter Forums
does this function work in CI 4.3.1 whereNotNull() - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: General (https://forum.codeigniter.com/forumdisplay.php?fid=1)
+--- Forum: Regional User Groups (https://forum.codeigniter.com/forumdisplay.php?fid=25)
+--- Thread: does this function work in CI 4.3.1 whereNotNull() (/showthread.php?tid=87619)



does this function work in CI 4.3.1 whereNotNull() - luckmoshy - 05-10-2023

PHP Code:
$query $this->db->table('table')
    ->whereNotNull('CustomerName')
    ->whereNotNull('ContactName')
    ->orWhereNotNull('Address')
    ->get();
$result $query->getResult(); 
it looks like not working, it shows null rows

Code:
SELECT CustomerName, ContactName, Address
FROM Customers
WHERE Address IS NOT NULL;



RE: does this function work in CI 4.3.1 whereNotNull() - JustJohnQ - 05-11-2023

Code:
SELECT CustomerName, ContactName, Address
FROM Customers
WHERE CustomerName IS NOT NULL
AND ContactName IS NOT NULL
OR Address IS NOT NULL;