Welcome Guest, Not a member yet? Register   Sign In
what is the difference between the two?
#1

[eluser]anna16[/eluser]
Hi guys

What is the difference between the two?

Code:
return $query->result();
vs.
Code:
return $this->db->get('user')->row_array();

also is result() and row_array() are PHP funtions? or CodeIgniter built-in method?

where i can find the description of these two methods?

Thanks in advanced.
#2

[eluser]mdvaldosta[/eluser]
Look in the active record user guide, I think that's where they're documented. query->result() returns an object and row_array() returns a single row as an array.
#3

[eluser]smilie[/eluser]
See: http://ellislab.com/codeigniter/user-gui...sults.html

Cheers,
Smilie
#4

[eluser]anna16[/eluser]
thanks guys
#5

[eluser]nuwanda[/eluser]
There's a lot of ways to access the result set.

A good read of the docs helps, but experimenting is even better. I was a little confused for a start as well.




Theme © iAndrew 2016 - Forum software by © MyBB