TDbException

Description

TDbCommand failed to execute the query SQL " Select CategoryID FROM tbl_Category where UniqueMainCategoryName = 'christmas' ": SQLSTATE[42S22]: Column not found: 1054 Unknown column 'CategoryID' in 'field list'

Source File

/home/holiday/framework-3.10/Data/TDbCommand.php (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 /home/holiday/framework-3.10/Data/SqlMap/Statements/TMappedStatement.php(398): TDbCommand->query()
#1 /home/holiday/framework-3.10/Data/SqlMap/Statements/TMappedStatement.php(378): TMappedStatement->runQueryForObject(Object(TDbConnection), Object(TDbCommand), NULL)
#2 /home/holiday/framework-3.10/Data/SqlMap/TSqlMapGateway.php(73): TMappedStatement->executeQueryForObject(Object(TDbConnection), Array, NULL)
#3 /home/holiday/public_html/protected/pages/SubSiloMetaContent.php(81): TSqlMapGateway->queryForObject('GetCategoryIdFr...', Array)
#4 /home/holiday/framework-3.10/Web/UI/TControl.php(1286): SubSiloMetaContent->onLoad(NULL)
#5 /home/holiday/framework-3.10/Web/UI/TPage.php(215): TControl->loadRecursive()
#6 /home/holiday/framework-3.10/Web/UI/TPage.php(198): TPage->processNormalRequest(Object(THtmlWriter))
#7 /home/holiday/framework-3.10/Web/Services/TPageService.php(498): TPage->run(Object(THtmlWriter))
#8 /home/holiday/framework-3.10/Web/Services/TPageService.php(444): TPageService->runPage(Object(SubSiloMetaContent), Array)
#9 /home/holiday/framework-3.10/TApplication.php(1095): TPageService->run()
#10 /home/holiday/framework-3.10/TApplication.php(382): TApplication->runService()
#11 /home/holiday/public_html/index.php(20): TApplication->run()
#12 {main}
2017-06-29 09:11 Apache/2.4.18 (Ubuntu) PRADO/3.1.10