有時候項目需要獲取數據庫最大的id值,比如生成訂單,做排序號,那么Thinkphp 如何獲取最大值id值。
$info=D('Customer')->where('1=1')->order('customer_id desc')->find();
//var_dump($info);
$this->sortid =$info['customer_id'];
文章來自 http://www.96net.com.cn
有時候項目需要獲取數據庫最大的id值,比如生成訂單,做排序號,那么Thinkphp 如何獲取最大值id值。
$info=D('Customer')->where('1=1')->order('customer_id desc')->find();
//var_dump($info);
$this->sortid =$info['customer_id'];
文章來自 http://www.96net.com.cn
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。