$asin =$_post[' key ']; $sql = "Select T. ' Item_code ', T. ' Package_area ', T. ' Asin ', T. ' SKU ', b. ' Pack_weight '"; $sql. = "From ' 1 _sku_comparison ' t left joins ' 1_product ' B on t. ' Item_code ' =b. ' Item_code ' "; $sql. =" WHERE T. ' SKU ' = ' ". $asin." ' OR T. ' ASIN ' = ' ". $asin." ' OR T. ' Item_code ' = ' ". $asin." ' ";
The problem now is when T. ' Item_code ' = $asin This condition is met when the data can be isolated, T. ' SKU ' = ' ". $asin." ' OR T. ' ASIN ' = ' ". $asin." ' When these two conditions meet, the report did not find the data, but I output $sql, with the output of $sql in phpMyAdmin can find data. I use Ajax to pass the value, what is this situation??
Reply to discussion (solution)
where T. ' SKU ' = ' ". $asin." ' and (T. ' ASIN ' = ' ". $asin." ' OR T. ' Item_code ' = ' ". $asin." ') ";
$sql. = "WHERE T. ' SKU ' = '". $asin. "' and (t. ' ASIN ' = '". $asin. "" OR T. ' Item_code ' = ' ". $asin." ') ";
T. ' SKU ' = ' ". $asin." ' OR T. ' ASIN ' = ' ". $asin." ' OR T. ' Item_code ' = ' ". $asin." ' ";
I want this condition, the problem is, now the execution result is Item_code can find out, ASIN and SKU field condition satisfies when cannot find out