Somehow it's a bit difficult for me to build a query like this: "Give me all entries of navigation where linkname not null"
$query = $this->db->get_where('navigation',array('linkname'!==NULL));
Giving me Error
Unknown column '0' in 'where clause'
SELECT
linkname,idnavigationFROM (navigation) WHERE0= 1
Any hints with this?
You can simply write the WHERE clause manually like this:
$this->db->get_where('navigation', 'linkname IS NOT NULL');
This will produce the following rendered SQL (tested on CI3; quoting will may differ by database driver).
SELECT *
FROM `navigation`
WHERE `linkname` IS NOT NULL
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With