[請益] 請教分頁及搜尋的功能...

看板PHP作者 (家庭公用ID XD)時間16年前 (2009/03/01 03:31), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
小弟練習寫的簡單php程式碼如下...(單純列出所有SQL查詢外加排一下版) <?php include("./config_department.php"); if($_SESSION['UserID']!="admin"){ echo "<body bgcolor='#FFFFCC'>權限不足!!</body>"; exit; } ?> <table width=99% cellspacing="0" cellpadding="0" border="0"> <tr> <td> <table width=100% cellspacing=2 border=0 cellpadding=1> <tr width=100%> <td width=6% height=16 bgcolor="#c8c8c8"> <font size="1">編號</font> </td> <td width=6% height=16 bgcolor="#c8c8c8"> <font size="1">所屬單位</font> </td> <td width=6% height=16 bgcolor="#c8c8c8"> <font size="1">地點1</font> </td> <td width=8% height=16 bgcolor="#c8c8c8"> <font size="1">地點2</font> </td> </tr> <?php $sql = "SELECT * FROM table"; $r = mysql_query($sql); while ($row = mysql_fetch_object($r)) { $subject = urlencode($row->subject); echo" <tr width=100%> <td width=6% height=16 style='font-size:10pt' bgcolor=#ffffff> $row->appli_no </td> <td width=6% height=16 style='font-size:10pt' bgcolor=#ffffff> $row->_dep </td> <td width=6% height=16 style='font-size:10pt' bgcolor=#ffffff> $row->location1 </td> <td width=8% height=16 style='font-size:10pt' bgcolor=#ffffff> $row->location2 </td> </tr> "; } ?> </table> </td> </tr> </table> 想請教版上先進,如果要增加分頁及查詢的功能,可以怎麼做呢? 還請高手指點小弟...感謝。 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.140.7.136 ※ 編輯: redhat1980 來自: 220.140.7.136 (03/01 03:32)
文章代碼(AID): #19gP4VWj (PHP)
文章代碼(AID): #19gP4VWj (PHP)