Issue Bug Rejected

#78285Rare bug with sql

Naberd Zendi 10/13/16, 16:16 updated 10/13/16, 16:37

Description

i have a code in my plugin

$where = "item=".$product['code'];
$resArr = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows("*", "tx_uwkmrma_domain_model_products", $where);

i use this same query at 2 points in my code, at first point it gives me data.
at second point it gives me sql error

ERROR => '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 '' at line 1' (146 chars)
   lastBuiltQuery => 'SELECT * FROM tx_uwkmrma_domain_model_products WHERE item=' (58 chars)

as you can see my where part is stripped of product code.

made an error in query by changing table name into tx_uwkmrma_domain_model_product so it’s product instead of products
debug output is :

ERROR => 'Table 'simcotest_db.tx_uwkmrma_domain_model_product' doesn't exist' (66 chars)
   lastBuiltQuery => 'SELECT * FROM tx_uwkmrma_domain_model_product WHERE item=1509000625' (67 chars)

what is wrong with it i can’t find it, it works at one place at fails at another.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.