답변 4개
select * from {$g5['g5_shop_category_table']} where substring(ca_id, 3, 2) = '20' and length(ca_id) = 4
뒤의 and length(ca_id) = 4 를 지우시면 102010 처럼 2단계가 20 이면서 3단계 이하인 카테고리도 함께 출력할 수 있습니다.
댓글을 작성하려면 로그인이 필요합니다.
고민을 해봐도 답을 못 찾겟습니다.
메뉴에서 메뉴를 클릭하면 메뉴링크가
http://himnae.com/shop/list.php?/list.php?">http://himnae.com/shop/list.php?/list.php?
이런식인데
http://himnae.com/shop/list.php?/list.php?select">http://himnae.com/shop/list.php?/list.php?select * from {$g5['g5_shop_category_table']} where substring(ca_id, 3, 2) = '80'
이렇게는 적용이 안되네요...
너무 모르는건가요?
답변에 대한 댓글 1개
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인
<?php
$casql = sql_query(" select * from {$g5['g5_shop_category_table']} where substring(ca_id, 3, 2) = '20' and length(ca_id) = 4 ");
for ($i=0;$row=sql_fetch_array($casql);$i++) {
echo $row['ca_name'].'<br>';
}
?>
위 코드를 연습 삼아 넣어보세요.