Acho que estou um pouco cansado nesse novo projeto ;)

Já corrigi o problema:  $this->set('section',$this->Section->findall("
Section.id = $id"));

Geovane

On 10/25/07, Geovane Silva <[EMAIL PROTECTED]> wrote:
>
> Pessoal, estou tentando realizar uma consulta
> $this->set('section',$this->Section->findall("id = $id"));
>
> E ocorre erro no resultado *SQL Error: * 1052: Column 'id' in where clause
> is ambiguous
>
> Algo errado no model?
>
> <?php
> class Section extends AppModel {
>
>     var $name = 'Section';
>     var $validate = array(
>         'nome' => VALID_NOT_EMPTY,
>         'img_titulo' => VALID_NOT_EMPTY,
>         'img_vertical_bar' => VALID_NOT_EMPTY,
>         'img_horizontal_bar' => VALID_NOT_EMPTY,
>         'publicado' => VALID_NOT_EMPTY,
>     );
>
>     //The Associations below have been created with all possible keys,
> those that are not needed can be removed
>     var $belongsTo = array(
>             'Categoria' =>
>                 array('className' => 'Categoria',
>                         'foreignKey' => 'categoria_id',
>                         'conditions' => '',
>                         'fields' => '',
>                         'order' => '',
>                         'counterCache' => ''
>                 ),
>
>     );
>
>     var $hasAndBelongsToMany = array(
>             'Ponto' =>
>                 array('className' => 'Ponto',
>                         'joinTable' => 'secoes_pontos',
>                         'foreignKey' => 'section_id',
>                         'associationForeignKey' => 'ponto_id',
>                         'conditions' => '',
>                         'fields' => '',
>                         'order' => '',
>                         'limit' => '',
>                         'offset' => '',
>                         'unique' => '',
>                         'finderQuery' => '',
>                         'deleteQuery' => '',
>                         'insertQuery' => ''
>                 ),
>
>     );
>
> }
> ?>
>
> --
> Geovane Lopes da Silva
>

--~--~---------~--~----~------------~-------~--~----~
Recebeu esta mensagem porque está inscrito em Grupo "Cake PHP Português" do 
Grupos Google.
 Para enviar mensagens para este grupo, envie um email para 
[email protected]
 Para anular a inscrição neste grupo, envie um email para [EMAIL PROTECTED]
 Para mais opções, visite este grupo em 
http://groups.google.com/group/cake-php-pt?hl=pt-PT
-~----------~----~----~----~------~----~------~--~---

Responder a