I love this one: $this->NameOfModel->id = $id;
$telephone = $this->NameOfModel->field('tel');
didn't know about it until you mentioned it.....I guess I still don't
completely understand the stateful-ness of the Model instances...
On May 18, 11:57 am, AD7six <[EMAIL PROTECTED]> wrote:
> On May 18, 6:22 pm, Enchy <[EMAIL PROTECTED]> wrote:
>
> > $this->set('telephone',$this->Order->findBySql("SELECT tel FROM
> > suppliers WHERE id='$id'"));
>
> > echo $telephone[0][suppliers][tel];
>
> > When I do this it moans that I have to define suppliers and tel
>
> Why not just do
>
> $this->NameOfModel->id = $id;
> $telephone = $this->NameOfModel->field('tel');
>
> OR
>
> $telephone = $this->NameOfModel->field('tel', array('NameOfModel.id'=>
> $id));
>
> OR
>
> $result = $this->NameOfModel->find(array(´ModelName.id'=>
> $id),array('tel'));
> $telephone = $result['NameOfModel']['tel'];
>
> OR
>
> $result = ->NameOfModel->findByID($id, array('tel')....
>
> etc
>
> Why use a framework if you are not going to use the framework ;)?
>
> hth,
>
> AD
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---