คำสั่ง select ที่ใช้ค่ะ
$sql="SELECT DISTINCT concat(user.fname,' ',user.lname) as fullname ,user.address, user.tel, user.email, ";
$sql.="confirm_or.oid, confirm_or.date FROM user INNER JOIN confirm_or ON user.uid=confirm_or.uid AND ";
$sql.="confirm_or.uid= '$user' AND confirm_or.oid ='$oid' ";
$sql1 = "select distinct oid from confirm_or where uid='$user' and date='2011-06-18' order by oid desc limit 1";
$res1 = mysql_query($sql1) or die(mysql_error());
list($lastOID) = mysql_fetch_row($res1);
$sql="SELECT DISTINCT concat(user.fname,' ',user.lname) as fullname ,user.address, user.tel, user.email, ";
$sql.="confirm_or.oid, confirm_or.date FROM user INNER JOIN confirm_or ON user.uid=confirm_or.uid AND ";
$sql.="confirm_or.oid ='$lastOID' ";
หรือ
$sql="SELECT DISTINCT concat(user.fname,' ',user.lname) as fullname ,user.address, user.tel, user.email, ";
$sql.="confirm_or.oid, confirm_or.date FROM user INNER JOIN confirm_or ON user.uid=confirm_or.uid AND ";
$sql.="confirm_or.uid='$user' AND date='2011-06-18' order by oid desc limit 1 ";