TDbException

Description

TDbCommand failed to execute the query SQL "SELECT p.*, s.name as section_name, s.link_name, si.image_205x205 FROM cms_pages p JOIN cms_section s ON s.id = p.section_id LEFT JOIN cms_section si ON si.id = p.section_id WHERE p.section_id IN () AND (p.search_filename = 'chat_week.html' OR p.search_title = 'chat_week.html') LIMIT 1": 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 ') AND (p.search_filename = 'chat_week.html' OR p.search_title =' at line 5

Source File

/home/babysitio/vhost/www/framework_master/Data/TDbCommand.php (258)

0247:             // Prado::trace('Query Row: '.$this->getDebugStatementText(), 'System.Data');
0248:             if($this->_statement instanceof PDOStatement)
0249:                 $this->_statement->execute();
0250:             else
0251:                 $this->_statement=$this->getConnection()->getPdoInstance()->query($this->getText());
0252:             $result=$this->_statement->fetch($fetchAssociative ? PDO::FETCH_ASSOC : PDO::FETCH_NUM);
0253:             $this->_statement->closeCursor();
0254:             return $result;
0255:         }
0256:         catch(Exception $e)
0257:         {
0258: throw new TDbException('dbcommand_query_failed',$e->getMessage(),$this->getDebugStatementText());
0259: } 0260: } 0261: 0262: /** 0263: * Executes the SQL statement and returns the value of the first column in the first row of data. 0264: * This is a convenient method of {@link query} when only a single scalar 0265: * value is needed (e.g. obtaining the count of the records). 0266: * @return mixed the value of the first column in the first row of the query result. False is returned if there is no value. 0267: * @throws TDbException execution failed 0268: */ 0269: public function queryScalar() 0270: {

Stack Trace

#0 /home/babysitio/vhost/www/framework_master/Data/DataGateway/TDataGatewayCommand.php(293): TDbCommand->queryRow()
#1 /home/babysitio/vhost/www/framework_master/Data/ActiveRecord/TActiveRecordGateway.php(236): TDataGatewayCommand->findBySql(Object(TActiveRecordCriteria))
#2 /home/babysitio/vhost/www/framework_master/Data/ActiveRecord/TActiveRecord.php(661): TActiveRecordGateway->findRecordBySql(Object(cmsPages), Object(TActiveRecordCriteria))
#3 /home/babysitio/vhost/www/public_html/protected/db_models/cmsPages.php(398): TActiveRecord->findBySql('??             ...')
#4 /home/babysitio/vhost/www/public_html/protected/pages/viewNote.php(22): cmsPages::getDataBySectionnameAndLinkname('chat', 'chat_week.html')
#5 /home/babysitio/vhost/www/framework_master/Web/UI/TControl.php(1322): viewNote->onPreRender(NULL)
#6 /home/babysitio/vhost/www/framework_master/Web/UI/TPage.php(227): TControl->preRenderRecursive()
#7 /home/babysitio/vhost/www/framework_master/Web/UI/TPage.php(203): TPage->processNormalRequest(Object(THtmlWriter))
#8 /home/babysitio/vhost/www/framework_master/Web/Services/TPageService.php(524): TPage->run(Object(THtmlWriter))
#9 /home/babysitio/vhost/www/framework_master/Web/Services/TPageService.php(470): TPageService->runPage(Object(viewNote), Array)
#10 /home/babysitio/vhost/www/framework_master/TApplication.php(1221): TPageService->run()
#11 /home/babysitio/vhost/www/framework_master/TApplication.php(410): TApplication->runService()
#12 /home/babysitio/vhost/www/public_html/index.php(48): TApplication->run()
#13 {main}
2014-10-24 16:33 Apache/2.2.22 (Debian) PRADO/3.2.2