Hello,
Could someone explain me where have I made an error in the query:
$sql .= "SELECT A.ProduitID as ProduitID, A.ParentProduitID as ParentProduitID, PD.LocaleID, PD.Description as ProduitDescription, P.ManufacturerVocID as ManufacturerID, MV.Text as ManufacturerName, P.CategoryID, C.Description as CategoryDescription ";
$sql .="FROM (((ProduitAccessory as A INNER JOIN Produit as P on A.ParentProduitID = P.ProduitID) ";
$sql .="INNER JOIN ProduitDescription as PD on A.ParentProduitID = PD.ProduitID) ";
$sql .="INNER JOIN Category as C on ( P.CategoryID = C.CategoryID ) and ( PD.LocaleID = C.LocaleID )) ";
$sql .="INNER JOIN Voc as MV on ( P.ManufacturerVocID = MV.VocID ) and ( PD.LocaleID = MV.LocaleID ) where ( A.ParentProduitID is not null ) ";
$sql .="UNION ALL ";
$sql .="SELECT A.ProduitID as ProduitID, PA.ProduitID as ParentProduitID, PD.LocaleID, PD.Description as ProduitDescription, P.ManufacturerVocID as ManufacturerID, MV.Text as ManufacturerName, P.CategoryID, C.Description as CategoryDescription ";
$sql .="FROM ((((ProduitAccessory as A ";
$sql .="INNER JOIN ProduitAttribute as PA on (PA.AttributeVocID = 'B000') and (PA.ValueVocID = A.ParentProduitLineVocID)) ";
$sql .="INNER JOIN Produit as P on PA.ProduitID = P.ProduitID) ";
$sql .="INNER JOIN ProduitDescription as PD on PA.ProduitID = PD.ProduitID) ";
$sql .="INNER JOIN Category as C on (P.CategoryID = C.CategoryID) and (PD.LocaleID = C.LocaleID)) ";
$sql .="INNER JOIN Voc as MV on (P.ManufacturerVocID = MV.VocID) and (PD.LocaleID = MV.LocaleID) ";
$sql .="WHERE (A.ParentProduitLineVocID is not null) and (A.ParentModelVocID is null) ";
$sql .="UNION ALL ";
$sql .="SELECT A.ProduitID as ProduitID, PA.ProduitID as ParentProduitID, PD.LocaleID, PD.Description as ProduitDescription, P.ManufacturerVocID as ManufacturerID, MV.Text as ManufacturerName, P.CategoryID, C.Description as CategoryDescription ";
$sql .="FROM (((( ProduitAccessory as A ";
$sql .="INNER JOIN ProduitAttribute as PA on ( PA.AttributeVocID = 'B001' ) and ( PA.ValueVocID = A.ParentModelVocID ) ) ";
$sql .="INNER JOIN Produit as P on PA.ProduitID = P.ProduitID) ";
$sql .="INNER JOIN ProduitDescription as PD on PA.ProduitID = PD.ProduitID ) ";
$sql .="INNER JOIN Category as C on ( P.CategoryID = C.CategoryID ) and ( PD.LocaleID = C.LocaleID ) ";
$sql .="INNER JOIN Voc as MV on ( P.ManufacturerVocID = MV.VocID ) and ( PD.LocaleID = MV.LocaleID ) )";
$sql .="WHERE (A.ParentModelVocID is not null ) ";
Thanks for your help