답변 3개
채택된 답변
+20 포인트
답변에 대한 댓글 3개
3년 전
다음 처럼 수정해보세요
$concat[] = "a.it_name";
수정
$concat[] = "a.it_name";
$concat[] = "replace(a.it_name, ' ','')";
$concat[] = "a.it_name";
수정
$concat[] = "a.it_name";
$concat[] = "replace(a.it_name, ' ','')";
댓글을 작성하려면 로그인이 필요합니다.
3년 전
컴퓨터(프로그램)이
오늘상품을
오늘, 상품 이렇게 두 단어로 인식하게 하는 것은 단순한 작업이 아닙니다.
트릭을 쓰자면
상품 제목을 띄어쓰기 있는 것과 없는 것 두 개(이상)를 저장하고 나중에 문자열 검색하는 거죠.
로그인 후 평가할 수 있습니다
답변에 대한 댓글 2개
댓글을 작성하려면 로그인이 필요합니다.
3년 전
맨밑에보면 $sql 보이잖아요 거기 밑에 echo $sql;로 하면 쿼리 어떻게 나와요?
로그인 후 평가할 수 있습니다
답변에 대한 댓글 2개
파트라슈님
3년 전
select b.ca_id, b.ca_name, count(*) as cnt from g5_shop_item a, g5_shop_category b where (a.ca_id = b.ca_id and a.it_use = 1 and b.ca_use = 1) and (concat(a.it_name,' ',a.it_explan2,' ',a.it_id,' ',a.it_basic) like '%쇼니%' and concat(a.it_name,' ',a.it_explan2,' ',a.it_id,' ',a.it_basic) like '%자견용%' ) group by b.ca_id order by b.ca_id 띄어쓰기해서 검색하면 상품이 나옵니다. 근데 띄어쓰기 없이 하면 안나옵니다.
파트라슈님
3년 전
띄어쓰기 않하면은 이렇게 나옵니다.
select b.ca_id, b.ca_name, count(*) as cnt from g5_shop_item a, g5_shop_category b where (a.ca_id = b.ca_id and a.it_use = 1 and b.ca_use = 1) and (concat(a.it_name,' ',a.it_explan2,' ',a.it_id,' ',a.it_basic) like '%쇼니%' and concat(a.it_name,' ',a.it_explan2,' ',a.it_id,' ',a.it_basic) like '%자견용%' ) group by b.ca_id order by b.ca_id
select b.ca_id, b.ca_name, count(*) as cnt from g5_shop_item a, g5_shop_category b where (a.ca_id = b.ca_id and a.it_use = 1 and b.ca_use = 1) and (concat(a.it_name,' ',a.it_explan2,' ',a.it_id,' ',a.it_basic) like '%쇼니%' and concat(a.it_name,' ',a.it_explan2,' ',a.it_id,' ',a.it_basic) like '%자견용%' ) group by b.ca_id order by b.ca_id
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인