Error 500: Sqlstate[42703]: Undefined Column

Hi,

Im new to framework stuff in general. Few days trying out Yii and im all confused with no idea where to find code for functions and what they actualy do. Too many object function calls… function(function(function(function(…))))

Hope to get a picture in my head how Yii work and where to look when something go wrong.

So far i try some tutorials and got gii to process database model from postgresql database. Something over 100 tables. Was nice to see all code appear instantly :) but,

the problem is with error on Manage page of table called CLIENTS.(same go for other tables). It happen when i enter some value in search input under column name. At least i think it is input for search. <_<


Error 500: <h1>CDbException</h1>

<p>CDbCommand failed to execute the SQL statement: SQLSTATE[42703]: Undefined column: 7 ERROR: column "id_cli" does not exist

LINE 1: SELECT COUNT(*) FROM “CLIENTS” “t” WHERE ID_CLI=‘10’

                                             ^. The SQL statement executed was: SELECT COUNT(*) FROM &quot;CLIENTS&quot; &quot;t&quot; WHERE ID_CLI=:ycp0 (C:&#092;Apache2&#092;htdocs&#092;yii&#092;framework&#092;db&#092;CDbCommand.php:528)&lt;/p&gt;&lt;pre&gt;#0 C:&#092;Apache2&#092;htdocs&#092;yii&#092;framework&#092;db&#092;CDbCommand.php(425): CDbCommand-&gt;queryInternal('fetchColumn', 0, Array)

CDbCommand.php

423 public function queryScalar($params=array())

424 {

425 $result=$this->queryInternal(‘fetchColumn’,0,$params);

426 if(is_resource($result) && get_resource_type($result)===‘stream’)

427 return stream_get_contents($result);

428 else

429 return $result;

430 }

The column is not id_cli but ID_CLI so the sql should look like:

SELECT COUNT(*) FROM “CLIENTS” “t” WHERE “ID_CLI”=‘10’

Also dont know why "t" is there but that is what code generate so i guess it must be there.

Question is: How to fix the sql statement and where to find code in Yii to make that change?

Every colum should be in "" for my tables. But i wonder why List for table CLIENTS(and others) work just fine. Any pointer how to see the sql of List page? Im debuging now and hope to find at least that sql.

Well this is just 1 thing that bug me :P Wonder if i can get a good understanding of Yii in a month.