|
|
|
จะให้มันแสดงในหน้านั้นให้รูปมันขึ้นที่ละ 5 รูปทำไง |
|
|
|
|
|
|
|
<?
$order=$_GET['order'];
if ($order=="") { $order=1;}
$start=$order-1;
include"../forum/connect/connect.php";
include"../forum/date.php";
$sql="select *from photo order by id_photo desc limit $start,1";
$result=mysql_db_query($dbname,$sql);
$r=mysql_fetch_array($result);
$id_photo=$r[id_photo];
$name_photo=$r[name_photo];
$detail_photo=$r[detail_photo];
$total=mysql_num_rows($result);
echo"display photo<br>";
echo"<a href='images/$name_photo'><img src='images/$name_photo' border=1></a><p>";
echo"<b>รายละเอียด : </b><br>";
echo"$detail_photo<p>";
if($order>1) {
$prev=$order-5;
echo"<a href='view.php?order=$prev'>กลับ</a> ";
}
echo"( $order of $total )";
if($order<>$total) {
$next=$order+5;
echo" <a href='view.php?order=$next'>ถัดไป</a>";
}
mysql_close();
?>
|
|
|
|
|
Date :
29 มี.ค. 2549 10:26:49 |
By :
ปุด |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ไม่ได้ครับ
|
|
|
|
|
Date :
29 มี.ค. 2549 12:16:27 |
By :
webmaster@com4spu |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<?
$order=$_GET['order'];
if ($order=="") { $order=1;}
$start=$order-1;
include"../forum/connect/connect.php";
include"../forum/date.php";
$sql="select *from photo order by id_photo desc limit $start,1";
$result=mysql_db_query($dbname,$sql);
$total=mysql_num_rows($result);
for($i=0;$i<5;$i++){
$r=mysql_fetch_array($result);
$id_photo=$r[id_photo];
$name_photo=$r[name_photo];
$detail_photo=$r[detail_photo];
echo"display photo<br>";
echo"<a href='images/$name_photo'><img src='images/$name_photo' border=1></a><p>";
echo"<b>รายละเอียด : </b><br>";
echo"$detail_photo<p>";
}
if($order>1) {
$prev=$order-5;
echo"<a href='view.php?order=$prev'>กลับ</a> ";
}
echo"( $order of $total )";
if($order<>$total) {
$next=$order+5;
echo" <a href='view.php?order=$next'>ถัดไป</a>";
}
mysql_close();
?
เชื่อมันเลยวะว่ามัน...
|
|
|
|
|
Date :
29 มี.ค. 2549 15:10:38 |
By :
ปุด |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ทฤษฎี
1.เริ่มต้นที่ค่าแรก ถ้าไมได้กำหนดมา(เรียกครั้งแรก)ให้เริ่มต้นที่ 0
if (!isset($start)) $start=0
2. วนลูป 5 ครั้ง พร้อมเพิ่ม $start ไปอีก 1
for ($i=$start; $i<$toal; $i++) {
3.แสดงรูปที่ $i+$start
<img src="....$image[($i+$start)]">
4.เพิ่ม $start ไปอีก 1
$start++
}
5.สร้างลิงค์สำหรับหน้าถัดไป
<a href="index.php?start=$start">หน้าถัดไป</a>
6.save ไฟล์เป็นชื่อในข้อ 5. (index.php)
http://goragod.6te.net
|
|
|
|
|
Date :
30 มี.ค. 2549 09:14:17 |
By :
goragod |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|