• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
or_where query

#1
Hi,
Having great fun with new release of CI4!
Great job guys!

I'm trying to run a query that fetches 1 row where either of fields (name or name1) equals "$name".

PHP Code:
return $this->asArray()
                    ->select('id')
                    ->where('name'$name)
                    ->or_where('name1'$name)
                    ->first(); 
Can somebody explain why I get the following error?
Call to a member function first() on null

How can I use or_where?

Thanks!
Reply


Messages In This Thread
or_where query - by oliver - 03-12-2020, 10:48 AM
RE: or_where query - by oliver - 03-12-2020, 01:40 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.