|
 |
|
พี่ๆ ช่วยดูโค้ดให้หน่อยครับ เกี่ยวกับการเรียงลำดับครับ |
|
 |
|
|
 |
 |
|
แล้วที่ ออกมาตอนนี้ ยังไม่ได้เรียงจากล่าสุดอีกหรอ
|
 |
 |
 |
 |
Date :
2009-10-31 15:36:26 |
By :
pokultra |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
มันไม่เรียงครับสับไปสับมาครับ
|
 |
 |
 |
 |
Date :
2009-10-31 15:39:13 |
By :
iveesa |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลองเปลี่ยนมาเรียงจาก id ดูครับ 
|
 |
 |
 |
 |
Date :
2009-10-31 16:33:03 |
By :
onizike |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลองแบบนี้ดูครับ
Code (PHP)
<?
echo "<b>$newtype[$id_type]</b><br>";
echo "<UL>";
$sql="select *,substr(date_new,6,4) as yy,substr(date_new,4,2) as mm,substr(date_new,1,2) as dd
from tb_sar where type_new='$id_type' order by yy,mm,dd desc ";
$result=mysql_db_query($dbname, $sql);
while($r=mysql_fetch_array($result)) {
$id_new=$r[id_new];
$title_new=$r[title_new];
$type_new=$r[type_new];
$pdf_new=$r[pdf_new];
$date_new=displaydate($r[date_new]);
echo "<LI>[$date_new]<a href='_pdf/$pdf_new' target='_blank'>$title_new</a></LI>";
}
echo "</UL>";
?>
ลองดูรูปแบบการเก็บข้อมูลของ date_new ด้วยครับ ผมยกตัวอย่างเป็นแบบ วว/ดด/ปปปป
หรือ 01/12/2552 ค่า
yy=2552
mm=12
dd=01
ประมาณนี้ครับ
|
 |
 |
 |
 |
Date :
2009-10-31 18:24:14 |
By :
tingtongkub |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณงับ เรียงจาก id_new ok ครับผม (เป็นไปตามวัตถุประสงค์ครับ) ขอบคุณงับ
|
 |
 |
 |
 |
Date :
2009-10-31 23:20:58 |
By :
iveesa |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 05
|