> u r having the job_id in $job_id > $c = new Criteria(); > $c->add(JobComponentPeer::JOB_ID,$job_id); > $c->add(JobComponentPeer::COMPONENT_ID,ComponentPeer::ID); > $components = ComponentPeer::doSelect($c); > > now all the components corresponding to that job_id are in $components > > now if u hav $job_id and also the price then > $c = new Criteria(); > $c->add(JobComponentPeer::JOB_ID,$job_id); > $c->add(JobComponentPeer::COMPONENT_ID,ComponentPeer::ID); > $c->add(JobComponentPeer::PRICE,$price); > $components = ComponentPeer::doSelect($c); > > this will give u all the components related to that job id having that > price.
There's one little mistake with this. It's: $c->addJoin(JobComponentPeer::COMPONENT_ID,ComponentPeer::ID); The DB won't return any rows otherwise. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~----------~----~----~----~------~----~------~--~---
