有时候项目需要获取数据库最大的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删除。