exec($sql); if($result){ $sql = "select ID from base_user where CREATE_TIME = '$time'"; $result=$pdo->query($sql); if($result){ $arr = $result->fetchAll(PDO::FETCH_ASSOC); $id = $arr[0]['ID']; $sql = "update base_customer set USER_ID = $id where CUST_ID = $post[id]"; $result=$pdo->exec($sql); if($result){ $code = 0; $info = 'success'; $massge = '成功'; }else{ $code = -1; $info = 'fail'; $massge = '失败'; } }else{ $code = -1; $info = 'fail'; $massge = '失败'; } }else{ $code = -1; $info = 'fail'; $massge = '失败'; } $json['code'] = $code; $json['info'] = $info; $json['massge'] = $massge; echo json_encode($json); ?>