Hello,
Is there someone who can explain me why I can't get any results when using the following php code? 🙂
$sql = "SELECT DISTINCT productfl1.*, productfl2.*, manufac.*, inventory.*
FROM catalog_category_product AS catproduct
JOIN catalog_product_flat_1 as productfl1
ON catproduct.product_id=productfl1.entity_id
JOIN catalog_product_flat_2 as productfl2
ON catproduct.product_id=productfl2.entity_id
JOIN manufacturers as manufac
ON manufac.m_name=productfl1.manufacturer_value OR
manufac.m_name=productfl2.manufacturer_value
JOIN cataloginventory_stock_item as inventory
ON inventory.product_id=productfl1.entity_id OR
inventory.product_id=productfl2.entity_id
WHERE productfl1.name LIKE '%".$con->real_escape_string($_POST['sku'])."%'
or productfl1.sku LIKE '%".$con->real_escape_string($_POST['sku'])."%'
or productfl2.name LIKE '%".$con->real_escape_string($_POST['sku'])."%'
or productfl2.sku LIKE '%".$con->real_escape_string($_POST['sku'])."%'";
// ERROR HANDLER //
$result = $con->query($sql) or die('Error :'.$con->error);
When I delete all the value's of productfl2, it works properly. 🙁
Thanks in advance! 😃
P.S. i'm using the DB of magento. 😉