I'm running Kohana stable release 3.2.0, just downloaded. My database configuration is done and bootstrap contains orm and database modules enabled. So is my model created.
My request looks like this:
$user = ORM::factory('user',$post)->find();
if($user->count_all()){
echo '<pre>';
print_r($user);
echo '</pre>';
}
Basically it should return some data, but it gives me an error.
Database_Exception [ 1103 ]: Incorrect table name '' [ SELECT COUNT(*) AS `records_found` FROM `` ]
Is this normal, that it displays empty table?
$table_name='user';
it still does not see it.$user = ORM::factory('user',$post)->find();
if($user->loaded()){
echo '<pre>';
print_r($user);
echo '</pre>';
}
Use loaded()
method to check that user was successfully loaded from DB.