developarvin
developarvin

Reputation: 5069

Codeigniter - Is there a way to access the data in the object from $this->db->get_where() directly?

I am just curious if there a way to access the data in the object from $this->db->get_where() directly without resorting to result_object(), result_array(), row_array(), row_object(), etc.

Even so, does this break good OOP practice of encapsulating objects?

Upvotes: 0

Views: 111

Answers (1)

Arun Jain
Arun Jain

Reputation: 5464

Yes. You can use it via:

$result = $this->db->get_where()->result();

Kindly ask if it not worked for you.

Select data and Generating query result posts might help you.

Upvotes: 1

Related Questions