新人求助如何取得新添加数据的ID

浏览:1075 发布日期:2015/03/02 分类:求助交流
我在使用基于ThinkPHP3.1开发的一套CMS系统,然后要添加商品订单,为此我建了两个表用于存放订单及订单商品列表:
order_info、order_goods
我现在可以提交订单并保存到order_info里,但我不知道怎么提取刚ID用于存到order_goods里,请高手指点一下啊!
order_info的添加过程:
$temp_order_sn='TEMP'.time();
$order_c=D('order_info');
$order_c->order_sn=$temp_order_sn;
$order_c->order_status='已下单';
$order_c->shipping_status='非注册用户';
$order_c->country='中国';
$order_c->province=$temp_Province;
$order_c->city=$temp_City;
$order_c->district=$temp_Area;
$order_c->address=$temp_address;
$order_c->tel=$temp_tel1;
$order_c->mobile=$temp_tel;
$order_c->best_time=$temp_getdate.' '.$temp_gettime1.'-'.$temp_gettime2;
$order_c->pay_name=$temp_address_name;
$order_c->add();



用于自增ID的字段为:order_id
最佳答案
评论( 相关
后面还有条评论,点击查看>>