을 반환 :내가이 SQL 쿼리가 NULL 열
products_id | dodavatelia_id ...
2153 | 67 ...
: 나는 MySQL 클라이언트 (명령 행 또는 Navicat는) 그것을 실행하면
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
을,이 결과를 얻을 수 내가 (는 mysql_query와 mysql_fetch_assoc와) PHP 스크립트에 의해 제품을 얻을 경우
, 나는 얻을 :
array (
'products_id' => NULL,
'dodavatelia_id' => '67',
...
);
products_id가 왜 NULL이됩니까?
고맙습니다. 하지만 이해가 안 돼요, 왜 그것이 mysql 커맨드 라인에서 동작하고 PHP에서는 그렇지 않습니다. – yetty
@yetty> SQL 쿼리가 제대로 작동하기 때문입니다. 업데이트 된 답변 확인 – koopajah