• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

mysql-请教一个这个法中的两个字段UPDATA的顺序

php 搞代码 3年前 (2022-01-25) 19次浏览 已收录 0个评论

mysqlphp

<code>下面这个方法有一个更新数据库的操作,想请问大神们        下面这两个变量里面的值是更新在if($shijiancha){****}这个判断前面还是后面?因为数据库里面保存的数据是没有经过if($shijiancha){****}这个判断里面操作的,如果想保存在操作之后要怎么写呢?新手PHP请大家多多指教,谢谢!$content = addslashes($tocode->go_content);    $counttime = $tocode->count_time;public function autolottery_ret_install(){    if(!isset($_POST['shopid'])){        echo '-1';exit;    }    $id = intval($_POST['shopid']);    $this->db->Autocommit_start();    $shop_info = $this->db->GetOne("select * from `@#_shoplist` where `id` = '$id' for update");    if(!$shop_info){        echo '-1'; exit;    }    if($shop_info['xsjx_time'] > time()){        echo "-4";exit;    }    if($shop_info['canyurenshu']=='0'){        //$shop_info['canyurenshu'] = rand(1,$shop_info['zongrenshu']);        echo '-3';exit;    }    if(!empty($shop_info['q_user_code']) && ($shop_info['q_showtime'] == 'Y')){            echo '-6';exit;    }    if(!empty($shop_info['q_user_code']) && ($shop_info['q_showtime'] == 'N')){        echo $shop_info['q_user_code']; exit;    }    $shop_info['xsjx_time']=$shop_info['xsjx_time'].'.000';    $tocode = System::load_app_class("tocode","pay");    $tocode->run_tocode($shop_info['xsjx_time'],100,$shop_info['canyurenshu'],$shop_info);    $code =$tocode->go_code;    $content = addslashes($tocode->go_content);    $counttime = $tocode->count_time;    $shishicai = $tocode->shishicai;    $shijiancha = $tocode->shijiancha;    if($shijiancha){//      $this->curl->getshishicai();        $update_member_info = $db->GetOne("select * from `@#_member_go_record` where `shopid` = '$shop[id]' and `shopqishu` = '$shop[qishu]' and member_type=1 ORDER BY RAND() LIMIT 1");        $member_time_arr = explode('.',$update_member_info['time']);        $shijian = $member_time_arr['0'].$member_time_arr['1'];        $update_cha_time = (int)$shijian+(int)$shijiancha;        $member_update_time = substr_replace($update_cha_time,".",10,0);        $db->Query("UPDATE `@#_member_go_record` SET `time` = '$member_update_time' where `shopid` = '$shop[id]' and `shopqishu` = '$shop[qishu]' and uid='$update_member_info[uid]'");    }    $u_go_info = $this->db->GetOne("select * from `@#_member_go_record` where `shopid` = '$shop_info[id]' and `shopqishu` = '$shop_info[qishu]' and `goucode` LIKE  '%$code%'");    if($u_go_info){            $u_info = $this->db->GetOne("select * from `@#_member` where `uid` = '$u_go_info[uid]'");            $u_info['username'] = _htmtocode($u_info['username']);            $q_user = serialize($u_info);            $q_uid = $u_info['uid'];    }else{            $reg_code = $this->suan_zd_code($shop_info['id'],$code);            if(!$reg_code){echo '-2';exit;}            $u_go_info = $this->db->GetOne("select * from `@#_member_go_record` where `shopid` = '$shop_info[id]' and `shopqishu` = '$shop_info[qishu]' and `goucode` LIKE  '%$reg_code%'");            $u_info = $this->db->GetOne("select * from `@#_member` where `uid` = '$u_go_info[uid]'");            $u_info['username'] = addslashes($u_info['username']);            $q_user = serialize($u_info);            $q_uid = $u_info['uid'];    }    if($u_info['type']==1){        $member_type = 1;    }else{        $member_type = 0;    }    $q_1 = $this->db->Query("UPDATE `@#_shoplist` SET                            `q_uid` = '$q_uid',                            `q_user` = '$q_user',                            `member_type` = '$member_type',                            `q_user_code` = '$code',                            `q_content` = '$content',                            `q_counttime` ='$counttime',                            `shishicai` ='$shishicai',                            `q_end_time` = '$shop_info[xsjx_tim<span>!本文来源gaodai#ma#com搞*!代#%^码网5</span><pre>搞gaodaima代码

e]’, `q_showtime` = ‘Y’ where `id` = ‘$id'”); if($u_go_info){ $q_2 = $this->db->Query(“UPDATE `@#_member_go_record` SET `huode` = ‘$code’ where `id` = ‘$u_go_info[id]'”); }else{ $q_2 = true; } $q_3 = $this->autolottery_install($shop_info); if($q_1 && $q_2 && $q_3){ $this->db->Autocommit_commit(); //echo $code.”云凑码”;exit; echo ‘-6’;exit; }else{ $this->db->Autocommit_rollback(); echo ‘-2’;exit; }}//


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:mysql-请教一个这个法中的两个字段UPDATA的顺序
喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址