Problem with join and activerecord

hi guys,

i have following code

public function getOwnedBy($userId,$limit=20,$offset=0,$orderBy='createdOn DESC'){
        $this->db->join('owners', ' = owners.imageId');
        $this->db->limit($limit, $offset);
        $query = $this->db->get();
        $images = $query->result();
        return $this->makeObjects($images);
But when i use the method i get following error:

A Database Error Occurred
Error Number: 1054
Unknown column '' in 'on clause'

SELECT * FROM (`images`) JOIN `owners` ON `images`.`id` = `owners`.`imageId` WHERE `deleted` = 0 AND `owners`.`userId` = '1' ORDER BY `images`.`createdOn` DESC LIMIT 20

it seams like there are the ' wrong set
Any ideas?
I use CI 1.7

[eluser]Cristiano Bianchi[/eluser]
Cannot it simply be that you have no field? The query seems fine...
Regards, Cristiano

i m such a fool! and you are exactly right! i was irretated by the quoting...

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.