카테고리 만드는 예제.
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에서 해주시기 바랍니다.
| 번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|---|
| 5126 | PHP |
|
3년 전 | 1799 | |
| 5125 | PHP | 3년 전 | 1604 | ||
| 5124 | PHP | 3년 전 | 2122 | ||
| 5123 | OS | 3년 전 | 1403 | ||
| 5122 | OS | 3년 전 | 1320 | ||
| 5121 | OS | 3년 전 | 1423 | ||
| 5120 | OS | 3년 전 | 1298 | ||
| 5119 | PHP |
|
3년 전 | 1150 | |
| 5118 | PHP | 3년 전 | 1366 | ||
| 5117 | Mobile |
|
3년 전 | 1408 | |
| 5116 | PHP | 3년 전 | 2297 | ||
| 5115 | MySQL |
welcome
|
3년 전 | 2910 | |
| 5114 | OS | 3년 전 | 2010 | ||
| 5113 | JavaScript | 3년 전 | 1543 | ||
| 5112 | PHP | 3년 전 | 1562 | ||
| 5111 | 기타 |
|
3년 전 | 1302 | |
| 5110 | PHP | 3년 전 | 4547 | ||
| 5109 | PHP | 3년 전 | 1583 | ||
| 5108 | 기타 |
|
3년 전 | 12178 | |
| 5107 | 기타 |
|
3년 전 | 2414 | |
| 5106 | 기타 |
|
3년 전 | 6325 | |
| 5105 | 기타 |
|
3년 전 | 3699 | |
| 5104 | 기타 |
|
3년 전 | 1507 | |
| 5103 | JavaScript | 3년 전 | 1699 | ||
| 5102 | 기타 |
|
3년 전 | 1273 | |
| 5101 | 기타 |
|
3년 전 | 1470 | |
| 5100 | 기타 |
|
3년 전 | 1310 | |
| 5099 | 웹서버 | 3년 전 | 2182 | ||
| 5098 | PHP | 3년 전 | 1332 | ||
| 5097 | PHP |
|
3년 전 | 1991 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기