웹마스터 팁
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
야구 자료실 2 (목록 만들기)
2003.02.02 18:33
<html>
<head>
<style>
<!--
input { text-align:center; border-width:0; border-style:none; }
*{ font-family:굴림; font-size:9pt; text-decoration:none;}
a:link { color:black; text-decoration:none; }
a:visited { color:black; text-decoration:none; }
a:active { color:black; text-decoration:none; }
a:hover { color:black; text-decoration:none; }
td { text-align:center; margin:0; padding:0; }
-->
</style>
<meta http-equiv="content-type" content="text/html; charset=euc-kr">
<title>순위</title>
<meta name="generator" content="Namo WebEditor v5.0(Trial)">
</head>
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
<?
include "config.php";
?>
<br> <table width="655" border="1" cellspacing="0" bordercolordark="white" bordercolorlight="#9966FF" bordercolor="#9999FF" align="center">
<tr>
<td width="30" bgcolor="#6699FF" height="25">
<p align="center">순위</td>
<td bgcolor="#99CCFF" height="25">
<p align="center">팀명</td>
<td bgcolor="#99CCFF" height="25">
<p align="center">성명</td>
<td bgcolor="#99CCFF" height="25">
<p align="center">경기수</td>
<td bgcolor="#99CCFF" height="25">
<p align="center">타석</td>
<td bgcolor="#99CCFF" height="25">
<p align="center">타수</td>
<td bgcolor="#99CCFF" height="25">
<p align="center"><a href=list.php?sort=2>안타</a></td>
<td bgcolor="#99CCFF" height="25">
<p align="center"><a href=list.php?sort=3>홈런</a></td>
<td bgcolor="#99CCFF" height="25">
<p align="center">사사구</td>
<td bgcolor="#99CCFF" height="25">
<p align="center">타점</td>
<td bgcolor="#99CCFF" height="25">
<p align="center"><a href=list.php?sort=1>타율</a></td>
<td bgcolor="#99CCFF" height="25">
<p align="center">출루율</td>
<td bgcolor="#99CCFF" height="25">
<p align="center"><a href=list.php?sort=4>투수승</a></td>
<td bgcolor="#99CCFF" height="25">
<p align="center">선수</td>
</tr>
<?
$ret="select * from score";
$no=0;
if ($sort==1)
{
$ret="select * from score order by data7 desc";
}
if ($sort==2)
{
$ret="select * from score order by data3 desc";
}
if ($sort==3)
{
$ret="select * from score order by data4 desc";
}
if ($sort==4)
{
$ret="select * from score order by data9 desc";
}
$result=mysql_query($ret);
$total = mysql_affected_rows();
while($data=mysql_fetch_array($result))
{
$no=$no+1;
?>
<tr>
<td width="30" bgcolor="#6699FF" height="25">
<p align="center"><?=$no?></p>
</td>
<td bgcolor="white" height="25">
<p align="center"><?=$data[team]?></p>
</td>
<td bgcolor="white" height="25">
<p align="center">
<?
echo $data[name];
if ($member[level]==1)
{
echo "<a href=edit.php?no=$data[no]>+</a>";
echo "<a href=del.php?no=$data[no]>-</a>";
}
?></p>
</td>
<td bgcolor="white" height="25">
<p align="center"><?=$data[data1]?></p>
</td>
<td bgcolor="white" height="25">
<p align="center"><?=$data[data2]?></p>
</td>
<td bgcolor="white" height="25">
<p align="center"><?=$data[data21]?></p>
</td>
<td bgcolor="white" height="25">
<p align="center"><?=$data[data3]?></p>
</td>
<td bgcolor="white" height="25">
<p align="center"><?=$data[data4]?></p>
</td>
<td bgcolor="white" height="25">
<p align="center"><?=$data[data5]?></p>
</td>
<td bgcolor="white" height="25">
<p align="center"><?=$data[data6]?></p>
</td>
<td bgcolor="white" height="25">
<p align="center"><?=$data[data7]?></p>
</td>
<td bgcolor="white" height="25">
<p align="center"><?=$data[data8]?></p>
</td>
<td bgcolor="white" height="25">
<p align="center"><?=$data[data9]?></p>
</td>
<td bgcolor="white" height="25">
<p align="center"><?=$data[data10]?></p>
</td>
</tr>
<?
}
?>
</table>
<? if ($member[level]==1)
{
?>
<p align="center"><a href="input.php">데이터 입력하기</a></p>
<?
}
?>
</body>
</html>
목록 보기는 단순한 mysql를 펼쳐 보여 주는 화면입니다.
항상 목록 보기에서 mysql를 가져 올때 반복되는 루틴은 있습니다.
<?
$ret="select * from score";
$no=0;
if ($sort==1)
{
$ret="select * from score order by data7 desc";
}
if ($sort==2)
{
$ret="select * from score order by data3 desc";
}
if ($sort==3)
{
$ret="select * from score order by data4 desc";
}
if ($sort==4)
{
$ret="select * from score order by data9 desc";
}
$result=mysql_query($ret);
$total = mysql_affected_rows();
while($data=mysql_fetch_array($result))
{
반복 출력될 화면
}
그리고 if문은 보시면 타율등을 클릭할때 입력 역순으로 보여 주던 것을 상황에 따라 ($sort 변수) 정렬을 나타내도록 되어 있습니다.
각 데이터는 $data[필드명] 이부분이 mysql에서 가져온 데이터의 변수 입니다.
<head>
<style>
<!--
input { text-align:center; border-width:0; border-style:none; }
*{ font-family:굴림; font-size:9pt; text-decoration:none;}
a:link { color:black; text-decoration:none; }
a:visited { color:black; text-decoration:none; }
a:active { color:black; text-decoration:none; }
a:hover { color:black; text-decoration:none; }
td { text-align:center; margin:0; padding:0; }
-->
</style>
<meta http-equiv="content-type" content="text/html; charset=euc-kr">
<title>순위</title>
<meta name="generator" content="Namo WebEditor v5.0(Trial)">
</head>
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
<?
include "config.php";
?>
<br> <table width="655" border="1" cellspacing="0" bordercolordark="white" bordercolorlight="#9966FF" bordercolor="#9999FF" align="center">
<tr>
<td width="30" bgcolor="#6699FF" height="25">
<p align="center">순위</td>
<td bgcolor="#99CCFF" height="25">
<p align="center">팀명</td>
<td bgcolor="#99CCFF" height="25">
<p align="center">성명</td>
<td bgcolor="#99CCFF" height="25">
<p align="center">경기수</td>
<td bgcolor="#99CCFF" height="25">
<p align="center">타석</td>
<td bgcolor="#99CCFF" height="25">
<p align="center">타수</td>
<td bgcolor="#99CCFF" height="25">
<p align="center"><a href=list.php?sort=2>안타</a></td>
<td bgcolor="#99CCFF" height="25">
<p align="center"><a href=list.php?sort=3>홈런</a></td>
<td bgcolor="#99CCFF" height="25">
<p align="center">사사구</td>
<td bgcolor="#99CCFF" height="25">
<p align="center">타점</td>
<td bgcolor="#99CCFF" height="25">
<p align="center"><a href=list.php?sort=1>타율</a></td>
<td bgcolor="#99CCFF" height="25">
<p align="center">출루율</td>
<td bgcolor="#99CCFF" height="25">
<p align="center"><a href=list.php?sort=4>투수승</a></td>
<td bgcolor="#99CCFF" height="25">
<p align="center">선수</td>
</tr>
<?
$ret="select * from score";
$no=0;
if ($sort==1)
{
$ret="select * from score order by data7 desc";
}
if ($sort==2)
{
$ret="select * from score order by data3 desc";
}
if ($sort==3)
{
$ret="select * from score order by data4 desc";
}
if ($sort==4)
{
$ret="select * from score order by data9 desc";
}
$result=mysql_query($ret);
$total = mysql_affected_rows();
while($data=mysql_fetch_array($result))
{
$no=$no+1;
?>
<tr>
<td width="30" bgcolor="#6699FF" height="25">
<p align="center"><?=$no?></p>
</td>
<td bgcolor="white" height="25">
<p align="center"><?=$data[team]?></p>
</td>
<td bgcolor="white" height="25">
<p align="center">
<?
echo $data[name];
if ($member[level]==1)
{
echo "<a href=edit.php?no=$data[no]>+</a>";
echo "<a href=del.php?no=$data[no]>-</a>";
}
?></p>
</td>
<td bgcolor="white" height="25">
<p align="center"><?=$data[data1]?></p>
</td>
<td bgcolor="white" height="25">
<p align="center"><?=$data[data2]?></p>
</td>
<td bgcolor="white" height="25">
<p align="center"><?=$data[data21]?></p>
</td>
<td bgcolor="white" height="25">
<p align="center"><?=$data[data3]?></p>
</td>
<td bgcolor="white" height="25">
<p align="center"><?=$data[data4]?></p>
</td>
<td bgcolor="white" height="25">
<p align="center"><?=$data[data5]?></p>
</td>
<td bgcolor="white" height="25">
<p align="center"><?=$data[data6]?></p>
</td>
<td bgcolor="white" height="25">
<p align="center"><?=$data[data7]?></p>
</td>
<td bgcolor="white" height="25">
<p align="center"><?=$data[data8]?></p>
</td>
<td bgcolor="white" height="25">
<p align="center"><?=$data[data9]?></p>
</td>
<td bgcolor="white" height="25">
<p align="center"><?=$data[data10]?></p>
</td>
</tr>
<?
}
?>
</table>
<? if ($member[level]==1)
{
?>
<p align="center"><a href="input.php">데이터 입력하기</a></p>
<?
}
?>
</body>
</html>
목록 보기는 단순한 mysql를 펼쳐 보여 주는 화면입니다.
항상 목록 보기에서 mysql를 가져 올때 반복되는 루틴은 있습니다.
<?
$ret="select * from score";
$no=0;
if ($sort==1)
{
$ret="select * from score order by data7 desc";
}
if ($sort==2)
{
$ret="select * from score order by data3 desc";
}
if ($sort==3)
{
$ret="select * from score order by data4 desc";
}
if ($sort==4)
{
$ret="select * from score order by data9 desc";
}
$result=mysql_query($ret);
$total = mysql_affected_rows();
while($data=mysql_fetch_array($result))
{
반복 출력될 화면
}
그리고 if문은 보시면 타율등을 클릭할때 입력 역순으로 보여 주던 것을 상황에 따라 ($sort 변수) 정렬을 나타내도록 되어 있습니다.
각 데이터는 $data[필드명] 이부분이 mysql에서 가져온 데이터의 변수 입니다.
댓글 0
제목 | 글쓴이 | 날짜 |
---|---|---|
여러분이 원하시던 로또복권 소스공개~ [12] | Dopesoul | 2003.02.22 |
NZEO 이메일 인증 따라하기 [또 수정 --;] [44] | teslaMINT | 2003.02.22 |
계정이 php를 지원하는지아닌지 잘 모를때... [16] | 격투왕맹호 | 2003.02.19 |
유용한 함수 몇가지...;;;; [7] | Yuki-H. | 2003.02.19 |
PHP,자바스크립트 제 3탄! 아래에 헤더로 asx감추기를 이용한 PHP무비 플레이어! | ☆좀비파우더™ | 2003.02.16 |
DB를 이용한 현재접속자 수 구하기 [6] | 김현석 | 2003.02.14 |
[초간단] 헤더로 asx 파일 음악 주소를 숨겨봐요. [9] | 모라미 | 2003.02.14 |
제로보드 스킨들이 어느 게시판에 쓰이는지 알아보는 소스 [12] | teslaMINT | 2003.02.11 |
V3 neo+ 항상 최신버전으로 자동링크시키기 [7] | 김현석 | 2003.02.08 |
자신의 디비내용을 출력해주는 소스 [출처: phpschool.com] [5] | 석이™ | 2003.02.05 |
제로보드식 에러페이지 만들기 [2] | .zeve | 2003.02.04 |
야구 자료실 2 (목록 만들기) | 한꼬마 | 2003.02.02 |
야구 자료실 만들기 1 [8] | 한꼬마 | 2003.01.30 |
PHP,자바스크립트 활용하기 #1 -무단링크라는 것은... [21] | ☆좀비파우더™ | 2003.01.30 |
^.^ 그림을 DB에 집어넣어 버리기.. [13] | 아이쿠 | 2003.01.30 |
lotto 번호 추출기 [7] | 갑빠™ | 2003.01.29 |
제로보드 코멘트 수정 기능 구현!! [13] | teslaMINT | 2003.01.28 |
NZEO 쪽지 수신 허용/거부 따라하기 ~(=ㅁ=)~ [12] | teslaMINT | 2003.01.28 |
[제로카운터 수정하기#4-초보용] 인트로에서 카운트 체크하고 메인에서 카운트 보여주기 [3] | 김태훈 | 2003.01.22 |
[제로카운터 수정하기#3-초보용] 어제 오늘 방문자수 변경하기 | 김태훈 | 2003.01.22 |