µù¥U
µn¿ý
º¶
½×¾Âª©³W
¸T¤î¦Cªí
»¡©ú
¦a¹Ï
¼Æ¦ì®Ñ»
¨p¤H®ø®§ (0)
¤½¦@®ø®§ (0)
½×¾Â¥ô°È (0)
¨t²Î®ø®§ (0)
¦n¤Í®ø®§ (0)
©«¤l®ø®§ (0)
³Â»¶®a±Ú°Q½×ª©ª©
»
PHP
»
PHP+MySQL ¤Jªù¹ê§@
» 8-3-2 «Ø¥ß¤À¶¿ï¾Ü
ªð¦^¦Cªí
¤U¤@¥DÃD
¤W¤@¥DÃD
µo©«
8-3-2 «Ø¥ß¤À¶¿ï¾Ü
¤p»x
µoµu®ø®§
¥[¬°¦n¤Í
¤p»x
(¤p»x)
·í«eÂ÷½u
´¿¸g¤]¬O¤ô¹q¤u
UID
9
©«¤l
1190
¥DÃD
394
ºëµØ
113
¿n¤À
1747
ª÷¿ú
1747
ÂI¦W
1
§@·~¨t²Î
Vista
³nÅ骩¥»
Office 2003
¾\ŪÅv
200
©Ê§O
¨k
¨Ó¦Û
¥xÆW
¦b½u®É¶¡
490 ¤p®É
µù¥U®É¶¡
2010-5-1
³Ì«áµn¿ý
2024-11-23
¡@¼ÊºÙ:
¤p»x
¡@ÀY»Î:
´¿¸g¤]¬O¤ô¹q¤u
ºÞ²zû
©«¤l
1190
¥DÃD
394
ºëµØ
113
¿n¤À
1747
ÂI¦W
1
§@·~¨t²Î
Vista
³nÅ骩¥»
Office 2003
¾\ŪÅv
200
©Ê§O
¨k
¨Ó¦Û
¥xÆW
µù¥U®É¶¡
2010-5-1
³Ì«áµn¿ý
2024-11-23
1
#
¸õÂà¨ì
»
¥¿§Ç¬Ý©«
¥´¦L
¦rÅé¤j¤p:
t
T
µoªí©ó 2011-4-20 10:52
|
¥u¬Ý¸Ó§@ªÌ
8-3-2 «Ø¥ß¤À¶¿ï¾Ü
8-3-2 «Ø¥ß¤À¶¿ï¾Ü
¬°¤FÅý¨Ï¥ÎªÌ¦Û¤v«ü©w·QnÆ[¬Ýªº¤À¶¤º®e¡A§Y¦bÂsÄý¾¹¤¤ªþ¥[°Ñ¼Æ¶Ç»¼µ¹§Ú̪ºµ{¦¡¡G¡]ToPage°Ñ¼ÆȧY¨Ï¥ÎªÌ·QÆ[¬Ýªº¤À¶¶½X¡^
http://localhost/php/ch8/ex08_22.php?ToPage=19
½Æ»s¥N½X
¤W¨Ò¤¤¡uToPage=19¡v§Y¥Nªí¨Ï¥ÎªÌ·QÆ[¬Ýªº¬O²Ä19Ó¤À¶ªº¸ê®Æ¡A¦]¦¹§ÚÌ´N¥²¶·¨Ï¥Î¡umysql_data_seek()¡v¨ç¼Æ¡A¨ì«ü©w¶¼ÆnÅã¥Üªº²Ä¤@µ§¸ê®Æ¿ý¤W¡A¤]´N¬O«ü©w¥Ø«e¡u§@¥Î¤¤¡v¸ê®Æ¿ýn²¾¨ìþ¤@Ó¤À¶ªº²Ä¤@µ§¸ê®Æ¿ý¤W¨Ó¶}©lÅã¥Ü¤º®e¡C
¥Ñ©ó¨Ï¥ÎªÌ¥i¦bºô§}¦C¦Û¦æ¿é¤JToPage°Ñ¼ÆÈ¡A¦]¦¹§ÚÌ¥h»Ý§@¤@¨Ç¹w¨¾±¹¬I¡A¨¾¤î¨Ï¥ÎªÌ«ü©w¤F¤£¥¿½Tªº¤À¶¶½X¡G
//¨M©w¶}©lÅã¥Üªº¤À¶
//Y¥¼«ü©w¤À¶«h¹w³]Åã¥Ü²Ä¤@¶
if (! isset($_REQUEST["ToPage"]))
{
$GoPage=1;
}
//Y«ü©w¤À¶¼Æ¤p©ó1«h¹w³]Åã¥Ü²Ä¤@¶
else if ($_REQUEST["ToPage"]<1)
{
$GoPage=1;
}
//Y«ü©w«ü©wªº¤À¶¶W¹LÁ`¤À¶¼Æ«hÅã¥Ü³Ì«á¤@¶
else if ($_REQUEST["ToPage"]>$TotalPage)
{
$GoPage=$TotalPage;
}
else
{
$GoPage=$_REQUEST["ToPage"];
}
//±N§@¥Î¤¤¸ê®Æ¿ý¦ì¸m²¾¨ì¤À¶ªº²Ä¤@µ§¸ê®Æ¿ý¤W¨Ó¶}©lÅã¥Ü¤º®e
mysql_data_seek($datalist,($GoPage-1)*10);
½Æ»s¥N½X
¼Ó¥D¼ö©«
½×¾Â¤£Åý¸ê¾ú¤ñ¸û²Lªº¤H¤U¸ü¬d¬Ýªþ¥óªº¥Î·N
EXCEL±MÄÝ°Q½×°Ï¦Û§Y¤é°_¤¤¾Ç¥Í¥H¤W·|û¤è
³Â»¶®a±Ú°Q½×°Ï ³q¥Îª©³W
OFFICE °ò¦±Ð¾Ç¼Æ¦ì¤Æ
ATX ¹q·½¨ÑÀ³¾¹¤â°Ê±Ò°Ê(¤£±µ¥D¾÷ªO±Ò°Ê)
¦Ò¼{Ãö³¬½×¾Âºô¯¸
³Â»¶®a±Ú°Q½×°ÏÁô¨pÅv¬Fµ¦»¡©ú
³Â»¶®a±Ú°Q½×°Ï ¸Û¼xª©¥D
¥Ñ½׾ÂÂà¶iªº¤¤¾Ç¥Íµ¥¯Å¥H¤W·|û,½ÐÃöª`!
14-2 ¸ê®Æ®w¹Ï¤ù¦s¨ú
¦¬ÂÃ
¤À¨É
¤ß¦w¡A¥¦w
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!
¤p»x
µoµu®ø®§
¥[¬°¦n¤Í
¤p»x
(¤p»x)
·í«eÂ÷½u
´¿¸g¤]¬O¤ô¹q¤u
UID
9
©«¤l
1190
¥DÃD
394
ºëµØ
113
¿n¤À
1747
ª÷¿ú
1747
ÂI¦W
1
§@·~¨t²Î
Vista
³nÅ骩¥»
Office 2003
¾\ŪÅv
200
©Ê§O
¨k
¨Ó¦Û
¥xÆW
¦b½u®É¶¡
490 ¤p®É
µù¥U®É¶¡
2010-5-1
³Ì«áµn¿ý
2024-11-23
¡@¼ÊºÙ:
¤p»x
¡@ÀY»Î:
´¿¸g¤]¬O¤ô¹q¤u
ºÞ²zû
©«¤l
1190
¥DÃD
394
ºëµØ
113
¿n¤À
1747
ÂI¦W
1
§@·~¨t²Î
Vista
³nÅ骩¥»
Office 2003
¾\ŪÅv
200
©Ê§O
¨k
¨Ó¦Û
¥xÆW
µù¥U®É¶¡
2010-5-1
³Ì«áµn¿ý
2024-11-23
3
#
µoªí©ó 2011-4-20 10:54
|
¥u¬Ý¸Ó§@ªÌ
ex08_22.php
<?
$conn = mysql_connect("localhost", "root", "12345a");
if(@mysql_select_db("STUDENTS", $conn))
{
//«ü©w´£¨ú¸ê®Æªº®Õ¹ï¦r¤¸ªí
mysql_query("set character set big5");
//¸ê®Æ®w¦s¦b,«Ø¥ßSQL©R¥O¦r¦ê
$SQL="SELECT * FROM studentlist";
//±N¦^¶Çµ²ªG¦s©ñ©óÅܼƤ¤
$datalist=mysql_query($SQL);
//¨ú±oÄæ¦ì¼Æ¶q
$fieldnum=mysql_num_fields($datalist);
//¨ú±o¸ê®Æ¿ý¼Æ¶q
$rowsnum=mysql_num_rows($datalist);
//pºâÁ`¦@¦³¦h¤Ö¤À¶
if (($rowsnum / 10) >intval($rowsnum / 10))
{
$TotalPage=intval($rowsnum / 10)+1;
}
else
{
$TotalPage=intval($rowsnum / 10);
}
//¨M©w¶}©lÅã¥Üªº¤À¶
//Y¥¼«ü©w¤À¶«h¹w³]Åã¥Ü²Ä¤@¶
if (! isset($_REQUEST["ToPage"]))
{
$GoPage=1;
}
//Y«ü©w¤À¶¼Æ¤p©ó1«h¹w³]Åã¥Ü²Ä¤@¶
else if ($_REQUEST["ToPage"]<1)
{
$GoPage=1;
}
//Y«ü©w«ü©wªº¤À¶¶W¹LÁ`¤À¶¼Æ«hÅã¥Ü³Ì«á¤@¶
else if ($_REQUEST["ToPage"]>$TotalPage)
{
$GoPage=$TotalPage;
}
else
{
$GoPage=$_REQUEST["ToPage"];
}
//±N§@¥Î¤¤¸ê®Æ¿ý¦ì¸m²¾¨ì¤À¶ªº²Ä¤@µ§¸ê®Æ¿ý¤W¨Ó¶}©lÅã¥Ü¤º®e
mysql_data_seek($datalist,($GoPage-1)*10);
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<title>½d¨Òex08_22</title>
</head><body>
<?="¦@$rowsnum µ§¸ê®Æ;¦@$TotalPage ±i¤À¶";?><p><center>
<?
for ($I=1; $I<=$TotalPage; $I++)
{
//¦pªG«D¥¿¦bÅã¥Üªº¤À¶«h«Ø¥ß¶½X³sµ²
IF ($I != $GoPage )
{
$myURL=$_SERVER["PHP_SELF"] . "?ToPage=";
echo "<a href=" . $myURL . $I . ">" . $I . "</a>|" ;
}
//¦pªG¬O¥¿¦bÅã¥Üªº¤è¶«h³æ¯ÂÅã¥Ü¶½X
else
{
echo $I . "|" ;
}
}
?>
<center><table border=1 width=100%>
<?
/**************¦C¥XÄæ¦ì©ïÀY***************/
echo "<tr>";
for ($x=0 ;$x<$fieldnum;$x++)
{
echo "<td>" . mysql_field_name($datalist,$x) . "</td>";
}
echo "</tr>";
/**************¦C¥XÄæ¦ì¸ê®Æ***************/
for ($y=0;$y<10;$y++)
{
//±N¸ê®Æ¿ýÂà´«¬°Äæ¦ì°}¦C¶°¦X
$fielddatas=mysql_fetch_array($datalist);
//¿é¥XÄæ¦ì¸ê®Æ
echo "<tr>";
for ($x=0;$x<$fieldnum;$x++)
{
echo "<td>" . $fielddatas[$x] . "</td>";
}
echo "</tr>";
}
?>
<table></body>
</html>
<?
}
else
{
echo "¸ê®Æ®w¤£¦s¦b";
}
?>
½Æ»s¥N½X
¤ß¦w¡A¥¦w
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!
TOP
¤p»x
µoµu®ø®§
¥[¬°¦n¤Í
¤p»x
(¤p»x)
·í«eÂ÷½u
´¿¸g¤]¬O¤ô¹q¤u
UID
9
©«¤l
1190
¥DÃD
394
ºëµØ
113
¿n¤À
1747
ª÷¿ú
1747
ÂI¦W
1
§@·~¨t²Î
Vista
³nÅ骩¥»
Office 2003
¾\ŪÅv
200
©Ê§O
¨k
¨Ó¦Û
¥xÆW
¦b½u®É¶¡
490 ¤p®É
µù¥U®É¶¡
2010-5-1
³Ì«áµn¿ý
2024-11-23
¡@¼ÊºÙ:
¤p»x
¡@ÀY»Î:
´¿¸g¤]¬O¤ô¹q¤u
ºÞ²zû
©«¤l
1190
¥DÃD
394
ºëµØ
113
¿n¤À
1747
ÂI¦W
1
§@·~¨t²Î
Vista
³nÅ骩¥»
Office 2003
¾\ŪÅv
200
©Ê§O
¨k
¨Ó¦Û
¥xÆW
µù¥U®É¶¡
2010-5-1
³Ì«áµn¿ý
2024-11-23
2
#
µoªí©ó 2011-4-20 10:54
|
¥u¬Ý¸Ó§@ªÌ
¤À¶ªº¼Æ¶q«Ü¦h¡A¸Ó¦p¦óÅý¨Ï¥ÎªÌ¦bºô¶¤¤ÂI¿ï©O¡H¤èªk«D±`²³æ¡Aª½±µ¨Ï¥ÎFor°j°é¨Ó¿é¥X¶½X³sµ²§Y¥i¡G
<?
for ($I=1; $I<=$TotalPage; $I++)
{
//¦pªG«D¥¿¦bÅã¥Üªº¤À¶«h«Ø¥ß¶½X³sµ²
IF ($I != $GoPage )
{
$myURL=$_SERVER["PHP_SELF"] . "?ToPage=";
echo "<a href=" . $myURL . $I . ">" . $I . "</a>|" ;
}
//¦pªG¬O¥¿¦bÅã¥Üªº¤è¶«h³æ¯ÂÅã¥Ü¶½X
else
{
echo $I . "|" ;
}
}
?>
½Æ»s¥N½X
¤W¨Ò¤¤ªº¡u$_SERVER["PHP_SELF"]¡v¡A¬O§Q¥Î_SERVER°}¦CÅܼƪ«¥ó¨ú±oÀô¹ÒÅܼơuPHP_SELF¡vªºÈ¡A¤]´N¬O¨ú±oµ{¦¡ºô¶¥»¨ªººô§}¡A±N¨ú±oªººô§}¸ê®Æ¥[¤WToPage°Ñ¼Æªº²Õ¦X¦¨¶W³sµ²³]©w¡A´N¥i¥HÅý¨Ï¥ÎªÌÂI¿ï¦ÓÅã¥Ü¨Ï¥ÎªÌ¦Û¤v·QÆ[¬Ýªº¤À¶¤º®e¡C
¤U¸ü
(51.31 KB)
2011-4-20 10:54
¹Ï8-25 ½d¨Òex08_22¡C
¤ß¦w¡A¥¦w
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!
TOP
ÀR«ä¦Û¦b :
Ä@n¤j¡B§Ón°í¡B®ðn¬X¡B¤ßn²Ó¡C
ªð¦^¦Cªí
¤U¤@¥DÃD
¤W¤@¥DÃD
EXCEL±MÄÝ°Q½×°Ï
Excel£¸¯ë°Ï
Excelµ{¦¡°Ï
¶i¶¥À³¥Î±M°Ï
OFFICE ¨t¦C
Word
PowerPoint
Access
Office¤£¤À°Ï
µ{¦¡»y¨¥
VB »P VB.Net
C »P C#
Java »P J#
µ{¦¡³]p¤£¤À°Ï
¸ê®Æ®w
ORACLE
My SQL
MS SQL
ºô¶³]p
ASP »P ASP.NET
PHP
PHP+MySQL ¤Jªù¹ê§@
JavaScript
FLASH / ActionScript
HTM/ HTML/ CSS
ºô¶³]p¤£¤À°Ï
¹q¸£»P§@·~¨t²Î
¹q¸£¦UºØµwÅé°Q½×
¤@¯ë¹q¸£³nÅé°Q½×
½×¾Â¨Æ°È
ºÞ²z¤½§i
§ë¶D¤Ï¬M
·s¤â´ú¸Õ
·R ¡E ¥Í¬¡
¤½¯q§G§iÄæ
¥Í¬¡»P·P°Ê
[¦¬Âæ¹¥DÃD]
[Ãöª`¦¹¥DÃDªº·s¦^´_]
[³q¹L QQ¡BMSN ¤À¨Éµ¹ªB¤Í]
¥Ó½Ð¤Í±¡Ãì±µ
Facebook¯»µ·