|
 |
|
จะกำหนดค่าให้แสดงบางส่วนหลังจาก a++ ยังไงครับ โค๊ดคือ ผมใช้การแรนด้อมมา 5 เรดคอร์ทเพื่อนำมาแสดงเป็น เทคนิคการถ่ายภาพ |
|
 |
|
|
 |
 |
|
<?
Require('connect.php');
$tb="tb_technic";
mysql_connect( $host,$username,$password) or die ("ติดต่อกับฐานข้อมูล Mysql ไม่ได้ ");
mysql_select_db($db) or die("เลือกฐานข้อมูลไม่ได้"); /* ทำการเลือกฐานข้อมูลก่อน */
$sql="SELECT * FROM $tb ORDER BY RAND() LIMIT 5 ";
$db_query=mysql_db_query($db,$sql);
$num_rows=mysql_num_rows($db_query); /* นับ Reccord ที่พบ */
$a=0;
while($a != $num_rows)
{
$result = mysql_fetch_array($db_query);
$id=$result[id];
$topic=$result[topic];
$text=$result[text];
$tolink=$result[tolink];
if ($a==0){
echo ' ',$result[topic'];
echo ' ',$result[text'];
echo ' ',$result['tolink'];
echo '<br />';
}else{
echo ' ',$result['topic'];
echo '<br />';
}
$a++;
}
mysql_close();
?>
|
 |
 |
 |
 |
Date :
2009-08-31 19:54:24 |
By :
num |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณครับ ทำได้แล้ว แต่ก็ขอบคุณมากๆครับ 
|
 |
 |
 |
 |
Date :
2009-08-31 22:18:01 |
By :
knight |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 01
|