mysql-请教一个这个法中的两个字段UPDATA的顺序
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_time]', `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; }}//</code>

热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

记事本++7.3.1
好用且免费的代码编辑器

SublimeText3汉化版
中文版,非常好用

禅工作室 13.0.1
功能强大的PHP集成开发环境

Dreamweaver CS6
视觉化网页开发工具

SublimeText3 Mac版
神级代码编辑软件(SublimeText3)

长URL(通常用关键字和跟踪参数都混乱)可以阻止访问者。 URL缩短脚本提供了解决方案,创建了简洁的链接,非常适合社交媒体和其他平台。 这些脚本对于单个网站很有价值

Laravel使用其直观的闪存方法简化了处理临时会话数据。这非常适合在您的应用程序中显示简短的消息,警报或通知。 默认情况下,数据仅针对后续请求: $请求 -

这是有关用Laravel后端构建React应用程序的系列的第二个也是最后一部分。在该系列的第一部分中,我们使用Laravel为基本的产品上市应用程序创建了一个RESTFUL API。在本教程中,我们将成为开发人员

Laravel 提供简洁的 HTTP 响应模拟语法,简化了 HTTP 交互测试。这种方法显着减少了代码冗余,同时使您的测试模拟更直观。 基本实现提供了多种响应类型快捷方式: use Illuminate\Support\Facades\Http; Http::fake([ 'google.com' => 'Hello World', 'github.com' => ['foo' => 'bar'], 'forge.laravel.com' =>

PHP客户端URL(curl)扩展是开发人员的强大工具,可以与远程服务器和REST API无缝交互。通过利用Libcurl(备受尊敬的多协议文件传输库),PHP curl促进了有效的执行

您是否想为客户最紧迫的问题提供实时的即时解决方案? 实时聊天使您可以与客户进行实时对话,并立即解决他们的问题。它允许您为您的自定义提供更快的服务

2025年的PHP景观调查调查了当前的PHP发展趋势。 它探讨了框架用法,部署方法和挑战,旨在为开发人员和企业提供见解。 该调查预计现代PHP Versio的增长

在本文中,我们将在Laravel Web框架中探索通知系统。 Laravel中的通知系统使您可以通过不同渠道向用户发送通知。今天,我们将讨论您如何发送通知OV
