Try adding:

var $displayField = 'title';

...to the top of your model.

PS: I presume the 'name' field exists in the table?

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 28 Jan 2011, at 06:28, andy_the ultimate baker wrote:

> hi bakers,
> good morning to all but it is not going good for me,
> since morning i m trying to resolve one error
> 
> "Unknown column 'State.name' in 'order clause'"
> 
> but i m not getting where exactly i m wrong,
> can anyone suggest me the solution on it,
> 
> a query is coming out in error is as fallows
> 
> Query: SELECT `State`.`id`, `State`.`title` FROM `states` AS `State`
> WHERE 1 = 1   ORDER BY `State`.`name` ASC
> 
> and my controller is doing this
> 
>       function add() {
> 
>               $states = $this->State->find('list');
>               //print_r($states);exit;
>               $cities = $this->City->find('all',
> array('conditions'=>array($states)));
>               $this->set(compact('states', 'cities'));
> 
> }
> 
> 
> and my model is as fallows
> 
> 
> <?php
> class State extends AppModel {
>       var $name = 'State';
>       var $order = "State.name ASC";
> }
> ?>
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to