我有我的注册表,您可以在其中选择帐户类型(例如Type1和Type2),如果您选择您的帐户类型,那么它将在指定的表中创建一个帐户(但不起作用)
<div class="form-group">
<label for ="acc_type">account type </label>
<div class="form-check">
<input class="form-check-input" type="radio" name="type" id="gridRadios1" value="type1" required >
<label class="form-check-label" for="gridRadios1">
Type1
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="type" id="gridRadios2" value="type2" required >
<label class="form-check-label" for="gridRadios2">
Type2
</label>
</div>
</div>
.php文件
$type=$_POST["type"];
if ($type='type2') {
$query = "INSERT INTO type2_acc VALUES(";
$query .= "NULL, '$name', '$pass', '$email')"; }
if ($type = "type1"){
$query = "INSERT INTO type1_acc VALUES(";
$query .= "NULL, '$name', '$pass', '$email')";}
每次它将帐户添加到type1_acc表中,如果我选择type2都没关系。如何更改?