Reputation: 981
I do have the following Doctrine query. My database is a MySQL.
public static function getLastList($user_id){
$user_id = 123;
$q = Doctrine_Query::create()
->from('list l')
->innerJoin('l.listUser lu ')
->where('lu.user_id = ?', $user_id)
->orderBy('e.created ASC')
->limit(1)
->execute();
if ($q == NULL) {
print_r('false');
} else {
print_r('not false');
}
}
I don't have a entry in my database with the user_id = 123. So what I expect is a "false". But "not false" is the result.
1.) Why?
2.) How can I divide with this specific query beteween "Yes, there ist a user" or "No, there is no user"?
Thanks!
Gunnar
Upvotes: 0
Views: 168