TDbException

Description

TDbCommand failed to execute the query SQL " SELECT DISTINCT tbl_Product . * , pc.CategoryID as CatID,pc.CategoryType as CatType FROM tbl_Product AS tbl_Product, tbl_ProductCategory AS pc WHERE tbl_Product.ProductID = pc.ProductId AND pc.CategoryId = 141 AND pc.CategoryType = 'SubSilo' AND tbl_Product.ProductIsActive = 'Active' AND tbl_Product.IsDeleted = 'No' and pc.Display = 'Yes' Order by ProductPriority ASC Limit 135,-135 ": 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 '-135' at line 1

Source File

/home/express/framework/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/express/framework/Data/SqlMap/Statements/TMappedStatement.php(232): TDbCommand->query()
#1 /home/express/framework/Data/SqlMap/Statements/TMappedStatement.php(207): TMappedStatement->runQueryForList(Object(TDbConnection), Array, Object(TDbCommand), NULL, NULL)
#2 /home/express/framework/Data/SqlMap/TSqlMapGateway.php(94): TMappedStatement->executeQueryForList(Object(TDbConnection), Array, NULL, -1, -1)
#3 /home/express/public_html/protected/pages/SubSiloMetaContent.php(843): TSqlMapGateway->queryForList('GetSubSiloProdu...', Array)
#4 /home/express/public_html/protected/pages/SubSiloMetaContent.php(608): SubSiloMetaContent->getData(135, -135, NULL, NULL)
#5 /home/express/public_html/protected/pages/SubSiloMetaContent.php(386): SubSiloMetaContent->PopulateData()
#6 /home/express/framework/Web/UI/TControl.php(1286): SubSiloMetaContent->onLoad(NULL)
#7 /home/express/framework/Web/UI/TPage.php(215): TControl->loadRecursive()
#8 /home/express/framework/Web/UI/TPage.php(198): TPage->processNormalRequest(Object(THtmlWriter))
#9 /home/express/framework/Web/Services/TPageService.php(498): TPage->run(Object(THtmlWriter))
#10 /home/express/framework/Web/Services/TPageService.php(444): TPageService->runPage(Object(SubSiloMetaContent), Array)
#11 /home/express/framework/TApplication.php(1095): TPageService->run()
#12 /home/express/framework/TApplication.php(382): TApplication->runService()
#13 /home/express/public_html/index.php(21): TApplication->run()
#14 {main}
2017-07-24 23:44 Apache/2.4.18 (Ubuntu) PRADO/3.1.7