2017-05-20 20:11
浏览 87

HTML - 单击按钮时的PHP UPDATE数据库

I have html page that has several button. I want to update my database column when I click a button.

In index.html

<form action="db.php" method="post">
    <button type="submit" id="1_y" class="btn btn-success">1.Lambayı Yeşil Yak</button>
    <button type="submit" id="1_k" class="btn btn-danger">1.Lambayı Kırmızı Yak</button></form>

And it looks like that


My db table Webtek


What I want is to update 'birinci_lamba' to 1 when 1_y is clicked and update 'birinci_lamba' again to 0 when 1_k is clicked.

So, what should be my db.php page ? Or any other advise to do that ?

1条回答 默认 最新

相关推荐 更多相似问题