CDbException

CDbCommand failed to execute the SQL statement: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens. The SQL statement executed was: SELECT * FROM `ex_muscles_details` `t` WHERE exId='100'

/var/www/clients/client1/web113/web/yii/framework/db/CDbCommand.php(541)

529         {
530             if($this->_connection->enableProfiling)
531                 Yii::endProfile('system.db.CDbCommand.query('.$this->getText().$par.')','system.db.CDbCommand.query');
532 
533             $errorInfo=$e instanceof PDOException ? $e->errorInfo : null;
534             $message=$e->getMessage();
535             Yii::log(Yii::t('yii','CDbCommand::{method}() failed: {error}. The SQL statement executed was: {sql}.',
536                 array('{method}'=>$method, '{error}'=>$message, '{sql}'=>$this->getText().$par)),CLogger::LEVEL_ERROR,'system.db.CDbCommand');
537 
538             if(YII_DEBUG)
539                 $message.='. The SQL statement executed was: '.$this->getText().$par;
540 
541             throw new CDbException(Yii::t('yii','CDbCommand failed to execute the SQL statement: {error}',
542                 array('{error}'=>$message)),(int)$e->getCode(),$errorInfo);
543         }
544     }
545 
546     /**
547      * Builds a SQL SELECT statement from the given query specification.
548      * @param array $query the query specification in name-value pairs. The following
549      * query options are supported: {@link select}, {@link distinct}, {@link from},
550      * {@link where}, {@link join}, {@link group}, {@link having}, {@link order},
551      * {@link limit}, {@link offset} and {@link union}.
552      * @return string the SQL statement
553      * @since 1.1.6

Stack Trace

#3
+
 /var/www/clients/client1/web113/web/protected/views/exNameDetails/view1.php(62): CActiveRecord->findAll("exId='100'", array("order" => "exname"))
57          <div class="well w1"> <h3 class="centerContent">Steps</h3> <br/><?php echo $steps;?>  </div>
58          <div class="well w1"> <h3 class="centerContent">Tips</h3> <br/><?php echo $tips;?>  </div>
59          <div class="well w1"> <h3 class="centerContent">Don't(s)</h3> <br/><?php echo $exdont;?>  </div>
60          <div class="well w1"> <h3 class="centerContent">Contradictions</h3> <br/><?php echo '';?>  </div>
61 <div class="well"> <h3 class="centerContent">Target Muscles</h3> <br/><?php 
62  $query=ExMusclesDetails::model()->findAll("exId='$id'",array('order'=>'exname') );
63 foreach($query as $result){
64 $display=$result['targeted_muscles'];
65 $res=Muscles::model()->find("id='$display'");
66 $d3=$res['muscles_name'];
67 echo $d3.'<br>';
#7
+
 /var/www/clients/client1/web113/web/protected/controllers/ExNameDetailsController.php(65): CController->renderPartial("view1", array("model" => exNameDetails))
60     }
61 
62   public function actionView1($name)
63     {
64         $this->renderPartial('view1',array(
65             'model'=>$this->loadModel1($name),
66         ));
67     }
68          public function loadModel1($name){
69             
70                 $model=ExNameDetails::model()->find("exercise_name='$name'");
#22
+
 /var/www/clients/client1/web113/web/index.php(13): CApplication->run()
08 defined('YII_DEBUG') or define('YII_DEBUG',true);
09 // specify how many levels of call stack should be shown in each log message
10 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
11 
12 require_once($yii);
13 Yii::createWebApplication($config)->run();
2024-03-28 19:52:07 Apache Yii Framework/1.1.13