CDbException

CDbCommand falhou ao executar o comando SQL: SQLSTATE[42000]: Syntax error or access violation: 1064 Você tem um erro de sintaxe no seu SQL próximo a 'ORDER BY Ordenar ASC, Id ASC' na linha 1. The SQL statement executed was: SELECT * FROM `produtos_fotos` `t` WHERE IdProduto = ORDER BY Ordenar ASC, Id ASC

/home/acrilcenteracrilicos/www/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
+
–
 /home/acrilcenteracrilicos/www/protected/controllers/ProdutosController.php(61): CActiveRecord->findAll(array("condition" => "IdProduto = ", "order" => "Ordenar ASC, Id ASC"))
56         $ProdutosCategorias = ProdutosCategorias::model()->find(array('condition' => 'Slug = "' . $Categoria . '"'));
57         if (empty($ProdutosCategorias)) {
58             throw new CHttpException(404, 'The specified post cannot be found.');
59         }
60         $Produtos = Produtos::model()->find(array('condition' => 'IdCategoria = ' . $ProdutosCategorias->Id . ' and Slug = "' . $Slug . '"'));
61         $ProdutosFotos = ProdutosFotos::model()->findAll(array('condition' => 'IdProduto = ' . $Produtos->Id, 'order' => 'Ordenar ASC, Id ASC'));
62         $ProdutosTamanhos = ProdutosTamanhos::model()->findAll(array('condition' => 'IdProduto = ' . $Produtos->Id, 'order' => 'Id ASC'));
63 
64         $this->pageTitle = $Produtos->SeoTitle;
65         Yii::app()->clientScript->registerMetaTag($Produtos->SeoDescription, 'description');
66         if (!empty($Produtos->SeoKeywords)) {
#18
+
–
 /home/acrilcenteracrilicos/www/index.php(12): CApplication->run()
07 $config = dirname(__FILE__) . '/protected/config/main.php';
08 defined('YII_DEBUG') or define('YII_DEBUG', true);
09 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 3);
10 
11 require_once($yii);
12 Yii::createWebApplication($config)->run();
2024-03-19 07:25:38 Apache Yii Framework/1.1.12