piadream

카테고리 만드는 예제.

· 2024-02-16 (금) 23:53:17 · 1581

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]

첨부파일

category.sql (2 KB) 7회 2024-02-16 23:53
|
댓글을 작성하시려면 로그인이 필요합니다.

개발자팁

5,403건

개발과 관련된 유용한 정보를 공유하세요. 질문은 QA에서 해주시기 바랍니다.

+
분류 제목 글쓴이 날짜 조회
PHP 24-06-30 조회 1,243
jQuery 24-06-19 조회 1,272
PHP 24-05-27 조회 1,714
Mobile 24-05-21 조회 1,392
기타 24-05-11 조회 1,223
23-10-30 조회 2,142
기타 23-10-24 조회 2,660
23-12-19 조회 1,672
24-01-10 조회 1,693
24-01-10 조회 1,675
24-01-15 조회 1,446
24-02-09 조회 5,086
24-02-16 조회 2,508
24-02-16 조회 2,611
24-02-18 조회 3,504
24-02-22 조회 3,272
24-02-25 조회 4,366
24-03-09 조회 2,462
JavaScript 24-02-26 조회 1,445
OS 24-02-25 조회 1,489
PHP 24-02-23 조회 1,654
PHP 24-02-18 조회 1,537
PHP 24-02-17 조회 1,457
PHP 24-02-16 조회 1,582
PHP 24-02-05 조회 1,597
JavaScript 24-01-28 조회 1,442
PHP 24-01-28 조회 1,382
PHP 24-01-27 조회 1,351
PHP 24-01-27 조회 1,481
PHP 24-01-27 조회 1,445