CDbException

CDbCommand failed to execute the SQL statement: SQLSTATE[42000]: Syntax error or access violation: 1064 syntax error, unexpected $end. The SQL statement executed was: SELECT COUNT(DISTINCT `Company`.`id`) FROM `companies` `Company` LEFT JOIN `products` `Product` ON (`Product`.`company_id`=`Company`.`id`) AND (Product.deleted = 0) LEFT OUTER JOIN `plans` `Plan` ON (`Company`.`plan_id`=`Plan`.`id`) LEFT OUTER JOIN `countries` `Country` ON (`Company`.`country_id`=`Country`.`id`) LEFT OUTER JOIN `business_type` `BusinessType` ON (`Company`.`business_type`=`BusinessType`.`id`) WHERE (((((((Company.deleted=0) AND (Company.point>=0)) AND (MATCH(Company.keywords_f , Company.company_name_f) AGAINST ('+تولید +پوشاک +(شلوار +جین' IN BOOLEAN MODE))) AND (Company.deleted=0)) AND (Company.point>=0)) AND (Company.deleted=0)) AND (Company.point>=0))

/home/namabazaarcom/YiiFramework/framework/db/CDbCommand.php(543)

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

Stack Trace

#4
+
 /home/namabazaarcom/public_html/protected/controllers/ListController.php(586): CActiveRecord->count(CDbCriteria)
581                     ),
582                     'Plan' => array('select' => ''),
583                     'Country' => array('select' => ''),
584                     'BusinessType' => array('select' => '')
585                         )
586                 )->count($model);
587 
588         $pages = new CPagination($count);
589 
590 //
591         $model->select = 'Company.id, plan_id, Company.company_name_f, Company.description_f, Company.image_logo, Company.keywords_f, Company.phone1, Company.city, Country.name_f AS _country_name, Plan.name_f AS _plan_name, Plan.image AS _plan_image, BusinessType.name_f AS _business_type ,Company.company_name_f,Company.keywords_f';
#5
+
 /home/namabazaarcom/public_html/protected/controllers/ListController.php(397): ListController->get_company(CDbCriteria)
392         $company_model->addCondition("Company.deleted=0");
393         $company_model->addCondition("Company.point>=0");
394         $company_model->with = array('Product' => array('on' => 'Product.deleted = 0', 'select' => '', 'joinType' => 'LEFT JOIN'));
395 
396 
397         $respons = $this->get_company($company_model);
398         $models = $respons['models'];
399         $pages = $respons['pages'];
400 
401         $count_company = $respons['count_company'];
402         $countries = $this->get_country($company_model);
#15
+
 /home/namabazaarcom/public_html/index.php(22): CApplication->run()
17 defined('YII_DEBUG') or define('YII_DEBUG', TRUE);
18 // specify how many levels of call stack should be shown in each log message
19 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 3);
20 
21 require_once($yii);
22 Yii::createWebApplication($config)->run();
2021-06-24 20:37:06 Apache Yii Framework/1.1.15