php - Yii CDbCommand failed to execute the SQL statement: SQLSTATE[42000]: -


i error when didn't while, i'm not sure if session problem or not.

the error message is:

cdbcommand failed execute sql statement: sqlstate[42000]: syntax error or access violation: 1064 have error in sql syntax; check manual corresponds mysql server version right syntax use near '=='1')' @ line 1. sql statement executed was: select * games_developers_app t (status :ycp0) , (developer_id==:ycp1)

the code is:

public function actionsortreject(){     $util = new utility();                   $util->detectmobilebrowser();        $util->checkwebsitelanguageincookies();      $this->layout = "masterlayout";      $count = '0';     $id = yii::app()->user->getstate('id');     $searchsort = "rej";     $sort = new cdbcriteria();     $sort->addsearchcondition('status', $searchsort);      $sort->addcondition('developer_id='.$id);     $models = gamesdevelopersapp::model()->findall($sort,array('developer_id'=>$id));      $this->render('/register/applist',array('models'=>$models,'count'=>$count));  } 

it seems worked fine, if missed in code please tell me. =)

the problem combination how have called compare , added additional parameters findall.

your compare should follows:

$sort->compare('developer_id', $id); 

and findall should be:

 $models = gamesdevelopersapp::model()->findall($sort);  

you use addcondition follows:

$sort->addcondition('developer_id=:developer_id'); $sort->params[':developer_id'] = $id; 

Comments

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -