I have this sql query:
SELECT *
FROM products p, products_description pd, products_to_categories c left
join products_sex ps on (c.products_id = ps.products_id),
categories cc
WHERE p.products_id = pd.products_id
and p.products_id = c.products_id
and cc.categories_id = c.categories_id
and p.products_status = 1
and p.products_price >= 15.8333333333
and p.products_price <= 40
and p.products_quantity > 0
and (ps.products_sex = "U" or ps.products_sex is null)
and (c.categories_id = 77 or cc.parent_id = 77)
ORDER BY products_sort_order, p.products_date_added desc, pd.products_name ASC
LIMIT 0, 40
If I execute it at MySQL client (command line or Navicat), I get this result:
products_id | dodavatelia_id ...
2153 | 67 ...
But if I get products by PHP script (with mysql_query and mysql_fetch_assoc), I get:
array (
'products_id' => NULL,
'dodavatelia_id' => '67',
...
);
Why am I getting the products_id NULL?