TDbCommand failed to execute the query SQL "SELECT i.*, as id_name, id.simple_name as id_simple_name, id.header as id_header, id.meta_description as id_meta_description, id.meta_keywords as id_meta_keywords, id.item as id_item, id.entries as id_entries, id.comments as id_comments, id.all_entries as id_all_entries, id.avatar as id_avatar, as ptp_photo, ptp.item as ptp_item, ptp.priority as ptp_priority, p.src as p_src, par.header as par_header, p.type as p_type, par.content as par_content FROM items i LEFT JOIN items_details id ON id.item = LEFT JOIN photo_to_page ptp ON ptp.item = LEFT JOIN photos p ON = LEFT JOIN paragraphs par ON par.item = WHERE add_date < UNIX_TIMESTAMP() AND GROUP BY id ORDER BY `add_date` DESC, `id` DESC": SQLSTATE[42000]: Syntax error or access violation: 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 'GROUP BY id ORDER BY `add_date` DESC, `id` DESC' at line 14

Source File

/var/www/ (230)

0219:         try
0220:         {
0221:             // Prado::trace('Query: '.$this->getDebugStatementText(), 'System.Data');
0222:             if($this->_statement instanceof PDOStatement)
0223:                 $this->_statement->execute();
0224:             else
0225:                 $this->_statement=$this->getConnection()->getPdoInstance()->query($this->getText());
0226:             return new TDbDataReader($this);
0227:         }
0228:         catch(Exception $e)
0229:         {
0230: throw new TDbException('dbcommand_query_failed',$e->getMessage(),$this->getDebugStatementText());
0231: } 0232: } 0233: 0234: /** 0235: * Executes the SQL statement and returns the first row of the result. 0236: * This is a convenient method of {@link query} when only the first row of data is needed. 0237: * @param boolean whether the row should be returned as an associated array with 0238: * column names as the keys or the array keys are column indexes (0-based). 0239: * @return array the first row of the query result, false if no result. 0240: * @throws TDbException execution failed 0241: */ 0242: public function queryRow($fetchAssociative=true)

Stack Trace

#0 /var/www/ TDbCommand->query()
#1 /var/www/ TDataGatewayCommand->findAllBySql(Object(TActiveRecordCriteria))
#2 /var/www/ TActiveRecordGateway->findRecordsBySql(Object(ItemsRecord), Object(TActiveRecordCriteria))
#3 /var/www/ TActiveRecord->findAllBySql('SELECT i.*, \n\t\t...')
#4 /var/www/ Main->refreshLatestArticle()
#5 /var/www/ Main->refreshPage()
#6 /var/www/ Main->onInit(NULL)
#7 /var/www/ TControl->initRecursive(NULL)
#8 /var/www/ TCompositeControl->initRecursive(NULL)
#9 /var/www/ TTemplateControl->initRecursive()
#10 /var/www/ TPage->processNormalRequest(Object(THtmlWriter))
#11 /var/www/ TPage->run(Object(THtmlWriter))
#12 /var/www/ TPageService->runPage(Object(Main), Array)
#13 /var/www/ TPageService->run()
#14 /var/www/ TApplication->runService()
#15 /var/www/ TApplication->run()
#16 {main}
2019-04-20 16:25 Apache/2.2.22 (Debian) PRADO/3.1.7