CodeIgniter Forums
Call to undefined function: row_array() - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Call to undefined function: row_array() (/showthread.php?tid=2721)



Call to undefined function: row_array() - El Forum - 08-21-2007

[eluser]Kemik[/eluser]
Hello,

I've used row_array() before so I'm not sure why it's giving an error

Code:
$this->db->select('user_name, email');
$this->db->where('user_id', $user_id);
$query = $this->db->from('users');
$data = $query->row_array();
                    
$data['message'] = '2';
$this->emailKickedUser($data);

Gives me:
Fatal error: Call to undefined function: row_array()

I have database in the autoload so it cannot be that. Other queries work fine. I just need to put the result in to the data array so it can be passed to the view and the email function.

Edit: Solved. I forgot the $this->db->get();

Thanks


Call to undefined function: row_array() - El Forum - 08-21-2007

[eluser]deviant[/eluser]
Don't you mean to use result_array() ?


Call to undefined function: row_array() - El Forum - 08-21-2007

[eluser]Kemik[/eluser]
row_array() works too. The difference is row_array() only returns one row.