$categories_query ="SELECT p.products_id
, p.products_quantity
, p.products_price
, p.products_status
,p.products_image
, pd.products_name
FROM products_description AS pd
INNER JOIN products AS p
ON p.products_id = pd.products_id
WHERE p.products_status = 1 and p.products_id <> $pid and pd.products_name LIKE CONCAT(LEFT('$products_name',10),'%')";
상대적인 항목이없는 경우에도 일부 페이지가 정상적으로 실행됩니다. 그러나 $products_name
이 A Bug's Life "Multi Pak" Special 2003 Collectors Edition
일 때 오류를 보여줍니다 :SQL 명령이 왜 오류를 표시합니까?
1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's Life "Multi Pak" Special 2003 Collectors Edition',10),'%')' at line 11
in:
[SELECT p.products_id...
왜? 어떻게 수정해야할까요?
대신 준비된 문을 사용해야합니까? 어떻게해야합니까? 감사합니다. – dreamchaser
@dreamchaser 코드 예제 링크가있는 답변을 업데이트했습니다. –