piadream

카테고리 만드는 예제.

· 2년 전 · 1130

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
|
댓글을 작성하시려면 로그인이 필요합니다.

개발자팁

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

+
분류 제목 글쓴이 날짜 조회
2년 전 조회 1,191
2년 전 조회 1,015
2년 전 조회 4,335
2년 전 조회 2,064
2년 전 조회 1,610
2년 전 조회 3,003
2년 전 조회 2,807
2년 전 조회 3,903
1년 전 조회 1,890
JavaScript 2년 전 조회 1,047
OS 2년 전 조회 1,065
PHP 2년 전 조회 1,238
PHP 2년 전 조회 1,142
PHP 2년 전 조회 1,031
PHP 2년 전 조회 1,131
PHP 2년 전 조회 1,116
JavaScript 2년 전 조회 1,019
PHP 2년 전 조회 961
PHP 2년 전 조회 919
PHP 2년 전 조회 1,027
PHP 2년 전 조회 1,005
PHP 2년 전 조회 1,104
정규표현식 2년 전 조회 916
JavaScript 2년 전 조회 1,039
PHP 2년 전 조회 2,504
PHP 2년 전 조회 1,981
PHP 2년 전 조회 1,019
node.js 2년 전 조회 1,816
JavaScript 2년 전 조회 1,522
JavaScript 2년 전 조회 1,441