Welcome Guest, Not a member yet? Register   Sign In
User Guide Error
#1

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

Quote:You can also pass a string to result() which represents a class to instantiate for each result object (note: this class must be loaded)

Code:
$query = $this->db->query("SELECT * FROM users;");

foreach ($query->result('User') as $user)
{
   echo $row->name; // call attributes
   echo $row->reverse_name(); // or methods defined on the 'User' class
}

Shouldn't it be:
Code:
$query = $this->db->query("SELECT * FROM users;");

foreach ($query->result('User') as $user)
{
   echo $user->name; // call attributes
   echo $user->reverse_name(); // or methods defined on the 'User' class
}
#2

[eluser]Unknown[/eluser]
Will it be alright if I post another typo error I spotted on user guide in this thread? Don't wish to open too many thread.

http://ellislab.com/codeigniter/user-gui...ecord.html

Scroll down to $this->db->insert_batch(), and you will noticed two header with "$this->db->insert_batch();".

The second header should be $this->db->update_batch() instead;




Theme © iAndrew 2016 - Forum software by © MyBB