Re: Need help converting this MySQL command into cakePHP find()

2009-05-07 Thread liaogz82
sorry mistake. I have correct the unknown column problem. But i faced another issue Undefined variable: conditions [APP/controllers/ subscribers_controller.php, line 24] On May 8, 10:09 am, liaogz82 wrote: > Sorry this doesnt work. It still gives me this error: > > Warning (512): SQL Error: 1

Re: Need help converting this MySQL command into cakePHP find()

2009-05-07 Thread liaogz82
Sorry this doesnt work. It still gives me this error: Warning (512): SQL Error: 1054: Unknown column 'SubscriberContact' in 'where clause' [CORE/cake/libs/model/datasources/dbo_source.php, line 514] is there a way to use joinModel method? On May 6, 3:59 pm, Mohsin Kabir wrote: > Hello , > Ther

Re: Need help converting this MySQL command into cakePHP find()

2009-05-06 Thread Mohsin Kabir
Hello , There is easy solution here : here you should First: make association subscribers has many subscriber_contacts and subscriber_contacts belongs to subscribers Second: # find IDs of friends here $friends = $this->Subscriber->SubscriberContact->find(’list’, array(’conditions’ =>array(‘Sub

Need help converting this MySQL command into cakePHP find()

2009-05-05 Thread liaogz82
Hi all, i need help to convert the following MySQL query to cakePHP find. I have 2 tables: subscribers and subscriber_contacts. One subscriber has many subscriber_contacts. The following is the MySQL query: SELECT s.* FROM subscribers s, subscriber_contacts sc where s.id = sc.subscriber_id and s