Welcome Guest, Not a member yet? Register   Sign In
CI4 $this-db->Table() inside foreach or outside
#7

(11-04-2021, 10:19 PM)manager Wrote: In your example "where" is a clause, so it's NEED key/value pair. So the first row of code is wrong.


https://codeigniter.com/user_guide/datab...html#where

According to the QueryBuilder reference, the second parameter is optional. What I have is corrected and it's the equivalent of:

PHP Code:
$builder->where('item_id'null); 

It produces the SQL "WHERE item_id IS NULL" The only downside to using it as I have it, is that it's somewhat counter-intuitive that $builder->where('item_id') produces IS NULL and not IS NOT NULL.
Reply


Messages In This Thread
RE: CI4 $this-db->Table() inside foreach or outside - by objecttothis - 11-04-2021, 10:45 PM



Theme © iAndrew 2016 - Forum software by © MyBB