 |
|
ใช้ php จัดการละกันน้อ
Code (PHP)
$result = mysql_query("select * from your_table_name order by id desc limit 2");
$count = mysql_num_rows($result);
if($count == 2){ // กรณีปกติคือมีมากกว่า 1 row
echo 'id : ' . mysql_result($result,1,0) . ', num : ' . mysql_result($result,1,1);
}else if($count == 1){ // กรณีมีแค่ 1 row
echo 'id : ' . mysql_result($result,1,0) . ', num : ' . mysql_result($result,1,1);
}else{
echo 'เสียใจด้วยไม่เจอข้อมูล';
}
|
 |
 |
 |
 |
Date :
2011-05-31 02:40:46 |
By :
PlaKriM |
|
 |
 |
 |
 |
|
|
 |