[Solved] SQL Multiple request


Try this instead:

$result = doQuery("SELECT DISTINCT c.PkID, c.CategoryName
                    FROM  " . HC_TblPrefix . "categories c 
                    WHERE c.IsActive = 1 AND c.PkID IN ('". implode("', '", explode(",", $catIDs)) ."')
                    ORDER BY c.CategoryName");

The reason your loop is only returning the last result is because you overwrite $resultCat every time, so when your loop is done, it just has the result of the last loop iteration. This really isn’t a good way to do what you want, anyways. Go with the solution above.

3

solved SQL Multiple request