<?php
$host="localhost";
$username="root";
$password="12345";
$db="mydatabase";
$tb="customer";
mysql_connect( $host,$username,$password) or die ("ติดต่อกับฐานข้อมูล Mysql ไม่ได้ ");
mysql_select_db($db) or die("เลือกฐานข้อมูลไม่ได้");
$result = mysql_query("SELECT * FROM customer");
?>
<table width="200" border="1">
<tr>
<td>Date</td>
<td>Time In</td>
<td>Time Out</td>
<td>ID Student</td>
<td>ID Department</td>
</tr>
<?
$result = mysql_query("SELECT * FROM customer order by dayofweek,timein");