在数据库表上插入表单数据取决于从下拉列表中选择的值[重复]

问题描述 投票:-1回答:1

我的数据库tbl1,tbl2和tbl3中有3个表。

我的HTML表单

<form action="" method="post">
<input type="text" class="form-control" id="department" name="department" placeholder="Enter Name" required>
<input type="text" class="form-control" id="cost" name="cost" placeholder="Enter Name" required>
   <select class="custom-select" name="roles" id="inputGroupSelect01 status">
                    <option selected>Choose...</option>
                    <option value="Available">Available</option>
                    <option value="Repair">Repair</option>
                    <option value="Checked Out">Checked Out</option>

                  </select>

添加用户

我的问题是,如果用户选择“可用”,则整个表单数据应转到tbl1,如果该值已被处理,则应转到tbl2,如果已将其签出,则应转到tbl3。

我该怎么办?

php html mysql forms
1个回答
0
投票

首先,您需要具有一个提交按钮才能将数据发送到服务器端

© www.soinside.com 2019 - 2024. All rights reserved.