简体   繁体   English

单击按钮时如何增加数据库中的值PHP MySQLi

[英]How to increment value in the database when the button is click PHP MySQLi

How to increment value in the database when the button is clicked 单击按钮时如何在数据库中增加值

function getPro(){
    global $con;
    $sada = "select * from products order by asd";
    $sdasdasa = mysqli_query($con, $get_pro);
    while ($asdasd = mysqli_fetch_array($run_pro)){

It seems that your code runs iteratively or 5 times due to some issue. 由于某些问题,您的代码似乎可以迭代运行5次。

Most probably, your If statement (in which update code is placed) is in body of some loop. 您的If语句 (放置更新代码)很可能在某个循环的主体中。 Either you have not closed the body of some loop undesirably or something like that. 您可能没有没有合乎需要地关闭了某些循环的主体,或者类似的东西。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM