Project

General

Profile

Actions

Bug #78285

closed

Rare bug with sql

Added by Naberd Zendi about 8 years ago. Updated about 8 years ago.

Status:
Rejected
Priority:
Must have
Assignee:
-
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2016-10-13
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
7
PHP Version:
5.6
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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.

Actions

Also available in: Atom PDF