|
|
|
ช่วยใส่โค้ดแบ่งหน้าแสดงผลให้ผมทีคับ SELECT `moban`.`moban_id`, FROM `moban` Inner Join `place` ON |
|
|
|
|
|
|
|
<html>
<body>
<?
$sql="SELECT
`moban`.`moban_id`,
`moban`.`moban_name`,
`place`.`moban_id`,
`place`.`type_id`,
`place`.`place_name`,
`place`.`place_id`,
`place`.`address`,
`place`.`soi`,
`place`.`road`,
`place`.`zipcode`,
`place`.`coordinate_x`,
`place`.`coordinate_y`,
`place`.`picture`,
`place`.`description`,
`tbtype`.`type_id`,
`tbtype`.`type_name`
FROM
`moban`
Inner Join `place` ON `moban`.`moban_id` = `place`.`moban_id`
Inner Join `tbtype` ON `tbtype`.`type_id` = `place`.`type_id` order by place_id";
$db_query=mysql_db_query($dbname,$sql);
$num_rows=mysql_num_rows($db_query); /* นับ Reccord ที่พบ */
?>
<!-- <A HREF="?catalogy=search_p"><IMG SRC="C:/AppServ/www/mymaepool/image/search.jpg" WIDTH="60" HEIGHT="60" BORDER="0" ALT=""></A> -->
<FORM METHOD=POST ACTION="?catalogy=search_p">
<INPUT TYPE="submit" value=ค้นหา style="width:65">
</FORM>
<CENTER><FONT SIZE="" COLOR="" FACE="TAHOMA"><B>สถานที่ทั้งหมด</B></FONT></CENTER>
<table width="61%" border="0" bordercolor="" align="center">
<tr>
<td width="5%" bgcolor="">
<div align="center"><B><FONT SIZE="2" COLOR="">รหัสสถานที่</FONT></B></div>
</td>
<td width="10%" bgcolor="">
<div align="center"><B><FONT SIZE="2" COLOR="">ชื่อสถานที่</FONT></B></div>
</td>
<td width="6%" bgcolor="">
<div align="center"><B><FONT SIZE="2" COLOR="">ชื่อหมู่บ้าน</FONT></B></div>
</td>
<td width="3%" bgcolor="">
<div align="center"><B><FONT SIZE="2" COLOR="">ประเภท</FONT></B></div>
</td>
<td width="8%" bgcolor="">
<div align="center"><B><FONT SIZE="2" COLOR="">ชื่อประเภท</FONT></B></div>
</td>
</tr>
</table>
<?
$a=0;
while($a < $num_rows)
{
$result = mysql_fetch_array($db_query);
$place_id=$result[place_id];
$moban_name=$result[moban_name];
$place_name=$result[place_name];
$type_id=$result[type_id];
$type_name=$result[type_name];
?>
<table width="61%" border="0" align="center">
<tr>
<td width="5%" bgcolor="">
<div align="center"><FONT SIZE="2" COLOR=""><?echo"$place_id";?></FONT></div>
</td>
<td width="10%" bgcolor="">
<div align="">
<A HREF="?catalogy=place_detail&place_id=<?=$place_id ?>"><FONT SIZE="2" COLOR=""><?echo " $place_name";?></FONT></A>
</div>
</td>
<td width="6%" bgcolor="">
<div align="">
<FONT SIZE="2" COLOR=""><?echo"$moban_name";?></FONT>
</div>
</td>
<td width="3%" bgcolor="">
<div align="center">
<FONT SIZE="2" COLOR=""><?echo " $type_id";?></FONT>
</div>
</td>
<td width="8%" bgcolor="">
<div align="left">
<FONT SIZE="2" COLOR=""><?echo " $type_name";?></FONT>
</div>
</td>
</tr>
</table>
<?
$a++;
}
echo"<center><br><FONT SIZE=2 >จำนวน $num_rows แห่ง</FONT></center>";
mysql_close();
?>
</body>
</html>
Tag : - - - -
|
|
|
|
|
|
Date :
14 มิ.ย. 2551 02:06:07 |
By :
แชยอง |
View :
1390 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<?
include("connect.php");
$rs=mysql_db_query($dbname, "select * from ชื่อตาราง");
$totalrow=mysql_num_rows($rs);
$pagesize=10; // ตรงนี้กำหนด จำนวนต่อหน้า
$totalpage=(int)($totalrow/$pagesize);
if(($totalrow%$pagesize)!=0){
$totalpage+=1;
}
if(isset($page)){
$pageno=$page;
$start=$pagesize*($pageno-1);
}else{
$pageno=1;
$start=0;
}
?>
ลองเอาไปใส่ดูนะครับ
|
|
|
|
|
Date :
14 มิ.ย. 2551 20:21:48 |
By :
SpyBNC |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 02
|