laravel5.1 如何返回上一步insert 操作产生的ID
mysql_insert_id()这个不能使用了
ErrorException in OrderController.php line 143:
mysql_insert_id(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead
ErrorException in OrderController.php line 143:
mysql_insert_id(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead
4 个回复
hutaoseven
赞同来自: yuanlaini1
如果你使用模型的话,直接返回整个被插入的数据对象;
少年,多看看文档
习惯把你宠坏
赞同来自: yuanlaini1
独自伤心
赞同来自:
$pc = new ProductClass;
$pc->user_name = $request->input('username');
$pc->email = $request->input('email');
$pc->password = md5($request->input('password'));
$pc->ec_salt = rand(1000,9999);
$pc->add_time = strtotime(date("Y-m-d H:i:s",time()));
$pc->action_list = "all";
$pc->save();
火红橘子
赞同来自: