Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.0k views
in Technique[技术] by (71.8m points)

mysql更新数据字段问题

$query = "UPDATE $pricetableSET $pricename=$pricename+'$price' WHERE $priceusername='$user' and $priceti='$payId'";//($pricename`为用户账户余额的字段名)
echo $query;
$result = mysqli_query($con,$query);
if ($result)

    echo "<p>充值成功!</p>";
else 
   echo "<p>充值失败。</p>";  

这种更新字段数据余额怎么写。刷新网页就加额度,刷新就加额度,如何写php语句只加一次重复动作就不加了


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

一个更新动作,必然是一个post请求触发,并且不论更新成功与失败,都必须跳出也没并清空后退,而且,操作钱的前提还要有一个流水号,每个流水号只允许操作一次资金.这是一整个逻辑,单独拿出来都无法控制,感觉你对http协议如何使用都不熟


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...