CDbException

CDbCommand failed to execute the SQL statement: SQLSTATE[42000] [1064] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND (`t`.`slug` = '' AND `t`.`status` = 'enabled' ) LIMIT 1' at line 1. The SQL statement executed was: SELECT * FROM `site_pages` `t` WHERE (t.site_id=) AND (`t`.`slug`=:yp0 AND `t`.`status`=:yp1) LIMIT 1

/var/www/vhosts/ticketworksonline.com/frontend/framework/db/CDbCommand.php(528)

516             return $result;
517         }
518         catch(Exception $e)
519         {
520             if($this->_connection->enableProfiling)
521                 Yii::endProfile('system.db.CDbCommand.query('.$this->getText().$par.')','system.db.CDbCommand.query');
522             $errorInfo = $e instanceof PDOException ? $e->errorInfo : null;
523             $message = $e->getMessage();
524             Yii::log(Yii::t('yii','CDbCommand::{method}() failed: {error}. The SQL statement executed was: {sql}.',
525                 array('{method}'=>$method, '{error}'=>$message, '{sql}'=>$this->getText().$par)),CLogger::LEVEL_ERROR,'system.db.CDbCommand');
526             if(YII_DEBUG)
527                 $message .= '. The SQL statement executed was: '.$this->getText().$par;
528             throw new CDbException(Yii::t('yii','CDbCommand failed to execute the SQL statement: {error}',
529                 array('{error}'=>$message)),(int)$e->getCode(),$errorInfo);
530         }
531     }
532 
533     /**
534      * Builds a SQL SELECT statement from the given query specification.
535      * @param array $query the query specification in name-value pairs. The following
536      * query options are supported: {@link select}, {@link distinct}, {@link from},
537      * {@link where}, {@link join}, {@link group}, {@link having}, {@link order},
538      * {@link limit}, {@link offset} and {@link union}.
539      * @return string the SQL statement
540      * @since 1.1.6

Stack Trace

#3
+
 /var/www/vhosts/ticketworksonline.com/frontend/protected/controllers/SiteController.php(28): CActiveRecord->findByAttributes(array("slug" => "", "status" => "enabled"))
23         return parent::init();
24     }
25 
26     public function actionPage($slug)
27     {
28         $data['page'] = Pages::model()->findByAttributes(array('slug'=>$slug,'status'=>'enabled'));
29         
30         if( !$data['page'] )
31             throw new CHttpException(404,'Page not found');
32         $this->layout = $data['page']->layout;
33         
#4
+
 /var/www/vhosts/ticketworksonline.com/frontend/protected/controllers/SiteController.php(89): SiteController->actionPage("")
84         Yii::app()->request->cookies['hide_cookies_msg'] = new CHttpCookie('hide_cookies_msg', 1);
85     }
86 
87     public function actionIndex()
88     {
89         $this->actionPage('');
90     }
91 
92     public function actionCheck_contact()
93     {
94         if(!Yii::app()->request->isAjaxRequest OR empty($_POST['Contact']))
#12
+
 /var/www/vhosts/ticketworksonline.com/frontend/index.php(39): CApplication->run()
34 defined('YII_DEBUG') or define('YII_DEBUG',true);
35 // specify how many levels of call stack should be shown in each log message
36 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
37 
38 require_once($yii);
39 Yii::createWebApplication($config)->run();
2024-03-29 02:03:39 Apache Yii Framework/1.1.12