Here it is my query:
$query_products = "
SELECT
p.Id
, p.product_sku
, p.product_name
, p.hide_product
, p.new_style_image
, p.ext
, p.product_thumb_image
, p.product_full_image
, SUM(s.stoc_final)
, s.active
FROM
produse p
LEFT JOIN stoc_intern s ON p.product_sku=s.cod_website
WHERE
(
(" . $product_sku_search . ")
OR (" . $product_name_search . ")
OR (" .$product_culoare_search . ")
)
AND p.hide_product != 'd'
GROUP by p.product_sku
ORDER BY SUM(s.stoc_final) DESC
LIMIT " . $items_per_page . "
OFFSET " . $_offset . "";
My problem is: the last field I'm selecting, the s.active one, has in the table the value of "n" but when I display it, it shows empty (echo $s_active
);
If I change the field s.active
with say other field s.description
, it will work.
Also, in the table "stoc_intern
" some fields that I select do display well, some do not display a thing (even if table data contains info).
Why is that?
only_full_group_by
sqlmode option