I am using ORM in Kohana and I want to get some record with id = 2 , but when I used:
$user = ORM::factory('user');
$user->find(2);
echo $user->name;
the result of it is always show me a value of a first record in table users, whats wrong with it?
As per code,
find()does not expect arguments:and per documentation:
and
find()is only to load first record from database. To avoid that, just use:Please test it, as I haven’t been using Kohana for a long time now.