CDbException

CDbCommand failed to execute the SQL statement: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ORDER BY 1-- -','458','459','460','461','462','463','464','465','466','467','...' at line 1. The SQL statement executed was: SELECT * FROM `product` `t` WHERE t.category_id IN ('457' ORDER BY 1-- -','458','459','460','461','462','463','464','465','466','467','468','469') AND t.is_active='1' ORDER BY t.access_count DESC, CASE WHEN (t.price is NOT NULL OR t.price>'0.00') THEN 1 ELSE 2 END,`t`.rank DESC, RAND() LIMIT 15

/home2/creole01/nouvoo.fr/domains/prod.nouvoo.fr/public_html/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

#5
+
 /home2/creole01/nouvoo.fr/domains/prod.nouvoo.fr/public_html/protected/models/Product.php(730): CDataProvider->getData()
725         $order="t.access_count DESC".($options['order']?",".$options['order']:"");
726         $options['offset']=0;
727         $options['limit']=$limit;
728     
729         $dataProvider=Product::getDataProvider($options,$order,$ignore_search);
730         $array=$dataProvider->getData();
731         
732         shuffle($array);
733                 
734         return $array;
735     }
#6
+
 /home2/creole01/nouvoo.fr/domains/prod.nouvoo.fr/public_html/protected/controllers/ProductController.php(699): Product::getMostPopularItems(array("category_id" => null, "module_id" => "458"))
694             $condition=array('category_id'=>isset($model->category->parent)?$model->category->parent_id:$model->category_id);
695             if (!$condition['category_id'])
696                 $condition['module_id']=$module_id;            
697             
698             // Most popular
699             $items=Product::getMostPopularItems($condition);        
700             $sidebarBlocs[]=array(
701                 'name' => AP_BLOC_PATH.'_featured_list',
702                 'title' => Yii::t('app','Populaires'),
703                 'items' => $items,
704             );
#19
+
 /home2/creole01/nouvoo.fr/domains/prod.nouvoo.fr/public_html/index.php(58): CApplication->run()
53         // header("Location: http://pro.".AP_DOMAIN_NAME."/".$url);
54         // exit;
55     // }
56 
57 require_once($yii);
58 Yii::createWebApplication($config)->run();
2024-03-29 02:04:25 Apache Yii Framework/1.1.14