抱歉,如果我要问的是一个愚蠢的问题,但我一直在阅读并尝试可用的代码,但它们都不起作用。这是我了解如何存储多个复选框值的链接如何插入多个复选框值在数据库中添加多个复选框值Mysqli-PHP 将多个复选框值存储到一条记录中我有一个带有多个复选框的表单,我需要将值存储到数据库中。我现在的问题是它不断弹出这个错误解析错误:语法错误,意外的“$chk”(T_VARIABLE),期望“)”下面是我的代码notification_form.php<div class="form-group row"> <label class="col-md-2 col-form-label">Potential Escalation: </label> <div class="col-md-5"> <input type="checkbox" id="potential_escalation[]" value="Under control with available resources. No potential of escalation" /> <text>Under control with available resources. No potential of escalation.</text> </div> <div class="col-md-5"> <input type="checkbox" id="potential_escalation[]" value="May requires additional resources (e.g. authorities, contractors, mutual aid groups)." /> <text>May requires additional resources (e.g. authorities, contractors, mutual aid groups).</text> </div></div><div class="form-group row"> <label class="col-md-2 col-form-label"></label> <div class="col-md-5"> <input type="checkbox" id="potential_escalation[]" value="Authorities may take over command and control" /> <text>Authorities may take over command and control.</text> </div> <div class="col-md-5"> <input type="checkbox" id="potential_escalation[]" value="May triggers significants authorities/ public community/ media interest." /> <text>May triggers significants authorities/ public community/ media interest.</text> </div></div>请注意,我有更多的输入,但我只是提供了我的表单代码的一部分,其中显示了我遇到问题的复选框。预先感谢您的指导和帮助。
1 回答
qq_遁去的一_1
TA贡献1725条经验 获得超7个赞
$checkbox1 = mysqli_real_escape_string($conn, $_POST['potential_escalation'] <-- 你错过了结束循环);
- 1 回答
- 0 关注
- 79 浏览
添加回答
举报
0/150
提交
取消