• 1 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Query single result

#1
Hello,

In CI 3 you could just do a call like $this->db->get()->result() to retreive a single result on where clause. But in CI 4 this is not available anymore (or think so) is there anyway to do this?
Reply

#2
(11-15-2016, 01:34 PM)superior Wrote: Hello,

In CI 3 you could just do a call like $this->db->get()->result() to retreive a single result on where clause. But in CI 4 this is not available anymore (or think so) is there anyway to do this?
I'm on my phone so please excuse the brevity. 

$db->get()->getResultArray();. //or similar. 

Method chaining is explained in the CI4 docs
Reply

#3
(11-15-2016, 08:44 PM)enlivenapp Wrote:
(11-15-2016, 01:34 PM)superior Wrote: Hello,

In CI 3 you could just do a call like $this->db->get()->result() to retreive a single result on where clause. But in CI 4 this is not available anymore (or think so) is there anyway to do this?
I'm on my phone so please excuse the brevity. 

$db->get()->getResultArray();. //or similar. 

Method chaining is explained in the CI4 docs

Got it in another way, but thank you for the feedback!
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


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