List last 48 Record

จาก Wiki2

ข้ามไปที่: นำทาง, สืบค้น
<?php
     $DBhost = "localhost";
     $DBuser = "beingpro_wd";
     $DBpass = "******";
     $DBname = "beingpro_wd";
     $table = "test";
     mysql_connect($DBhost,$DBuser,$DBpass) or die("Unable to connect to database");
     mysql_select_db("$DBname") or die("Unable to select databaser name = $DBname");
     $sqlquery = "SELECT * FROM $table ORDER BY ID DESC LIMIT 48";
     $results = mysql_query($sqlquery);
        
     while ($row = mysql_fetch_array($results))
     {
  	echo $row['id']. " ---  ". $row['datetime']." ---  ".$row['timestamp']."<br/>";
     }
      
     mysql_close();
   
?>
รับข้อมูลจาก "http://www.noklek.com/wiki2/index.php/List_last_48_Record"
เครื่องมือส่วนตัว