PHP开发实例大全(提高卷) 中文完整pdf扫描版[244MB]
$add = M("Users");
$Ret = -1;
try{
$data = array('opeind'=>'o5Y-RwfCIidSkL5LhTMVWKPxxx','user_name'=>'sdfsadf','account'=>'123456');
$Ret =$add->add($data);
}catch(\Exception $e){
if($e->getCode()==23000){
echo "插入的数据Unique导致的错误";
die();
}
}
转载请注明:谷谷点程序 » thinkphp插入重复数据处理异常