1. 程式人生 > >TP 查詢某一條件欄位 並 排序

TP 查詢某一條件欄位 並 排序

例:

SELECT `content` FROM `app_sms_statistics` WHERE ( mobile= '15300330047' ) ORDER BY time DESC LIMIT 1

$sms_statistics =  M('sms_statistics');   
$sms_statis = $sms_statistics->order('time DESC')->where("mobile= "."'$phone'")->getField('content');
echo $sms_statistics->getlastsql();