PHP为什么莫名其妙的执行了两次呢
<?phprequire_once('config.db.php');$cid=$_GET['cid'];$orderid=$_GET['orderid'];$json=...
<?php
require_once('config.db.php');
$cid=$_GET['cid'];
$orderid=$_GET['orderid'];
$json=array();
$cxoid=$db->fetOne('py_data','orderid',"orderid='{$orderid}'");
file_put_contents('1.txt','select'."\r\n",FILE_APPEND);
if($cxoid){
file_put_contents('1.txt','panduan'."\r\n",FILE_APPEND);
$json["result"]="5";
$json["message"]="订单号重复";
echo json_encode($json);
exit();
}
$uid=$db->scalar("select uid from py_commercial where id={$cid}","uid"); //取出UID
file_put_contents('1.txt','insert'."\r\n",FILE_APPEND);
$db->add('py_data',array(uid=>$uid,cid=>$cid,stime=>date('Y-m-d H:i:s'),orderid=>$orderid));
出来的结果是:
select
insert
select
panduan 展开
require_once('config.db.php');
$cid=$_GET['cid'];
$orderid=$_GET['orderid'];
$json=array();
$cxoid=$db->fetOne('py_data','orderid',"orderid='{$orderid}'");
file_put_contents('1.txt','select'."\r\n",FILE_APPEND);
if($cxoid){
file_put_contents('1.txt','panduan'."\r\n",FILE_APPEND);
$json["result"]="5";
$json["message"]="订单号重复";
echo json_encode($json);
exit();
}
$uid=$db->scalar("select uid from py_commercial where id={$cid}","uid"); //取出UID
file_put_contents('1.txt','insert'."\r\n",FILE_APPEND);
$db->add('py_data',array(uid=>$uid,cid=>$cid,stime=>date('Y-m-d H:i:s'),orderid=>$orderid));
出来的结果是:
select
insert
select
panduan 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询