TDbException

Description

TDbCommand failed to execute the query SQL " Select * from tbl_Product where CategoryID=9 and ProductCode like '%HC' and ProductIsActive='Active' AND tbl_Product.IsDeleted = 'No' Order by ProductPriority asc Limit 120,-91 ": 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 '-91' 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/ProductList.php(396): TSqlMapGateway->queryForList('GetProducts_For...', Array)
#4 /home/express/public_html/protected/pages/ProductList.php(357): ProductList->getData(120, -91, NULL, NULL)
#5 /home/express/public_html/protected/pages/ProductList.php(138): ProductList->PopulateData()
#6 /home/express/framework/Web/UI/TControl.php(1286): ProductList->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(ProductList), 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-08-21 20:24 Apache/2.4.18 (Ubuntu) PRADO/3.1.7