Welcome to OStack Knowledge Sharing 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 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...