카테고리 만드는 예제.
SQL은 파일 첨부
[code]
<?php
include("conn.php");
$cate_sql="select * from category order by groupidx asc , previdx asc , depthidx asc";
$cate_result=mysqli_query($conn,$cate_sql);
$cate_total=mysqli_num_rows($cate_result);
if($cate_total < 1 ) {}
else {
echo "<div>";
while($cates=mysqli_fetch_assoc($cate_result)) {
$prevtitle=stripslashes($cates['prevtitle']);
$previd=stripslashes($cates['previd']);
$depthtitle=stripslashes($cates['depthtitle']);
$depthid=stripslashes($cates['depthid']);
$previdx=stripslashes($cates['previdx']);
$depthidx=stripslashes($cates['depthidx']);
if(($depthidx < 1) || ($depthidx == false || null) || empty($depthidx)) {
echo "- 2<a href=$previd>$prevtitle</a>-</div>";}
if(($previdx >=1) && ($depthidx >=1)) {
echo "<pre>1- $depthtitle - $depthid - </pre>";
}
else{}
}
}
?>
[/code]
게시판 목록
개발자팁
질문은 QA에서 해주시기 바랍니다.
| 번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|---|
| 5336 | 1년 전 | 959 | |||
| 5335 | 1년 전 | 980 | |||
| 5334 | 1년 전 | 893 | |||
| 5333 | 1년 전 | 721 | |||
| 5332 |
바다클라우드
|
1년 전 | 3649 | ||
| 5331 |
뽕엄능브라
|
1년 전 | 1675 | ||
| 5330 | 1년 전 | 1335 | |||
| 5329 |
|
1년 전 | 2658 | ||
| 5328 | 1년 전 | 2465 | |||
| 5327 | 1년 전 | 3653 | |||
| 5326 | 1년 전 | 1554 | |||
| 5325 | JavaScript |
|
1년 전 | 695 | |
| 5324 | OS | 1년 전 | 759 | ||
| 5323 | PHP |
|
1년 전 | 902 | |
| 5322 | PHP |
|
1년 전 | 801 | |
| 5321 | PHP |
|
1년 전 | 659 | |
| 5320 | PHP |
|
1년 전 | 761 | |
| 5319 | PHP |
techstar
|
1년 전 | 809 | |
| 5318 | JavaScript |
|
1년 전 | 675 | |
| 5317 | PHP |
|
1년 전 | 620 | |
| 5316 | PHP |
|
1년 전 | 582 | |
| 5315 | PHP |
|
1년 전 | 690 | |
| 5314 | PHP |
|
1년 전 | 669 | |
| 5313 | PHP |
techstar
|
1년 전 | 769 | |
| 5312 | 정규표현식 |
|
1년 전 | 646 | |
| 5311 | JavaScript |
|
1년 전 | 716 | |
| 5310 | PHP |
|
1년 전 | 2127 | |
| 5309 | PHP |
techstar
|
1년 전 | 1616 | |
| 5308 | PHP |
techstar
|
2년 전 | 680 | |
| 5307 | node.js |
swallow
|
2년 전 | 1433 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기