抱歉,如果我要问的是一个愚蠢的问题,但我一直在阅读并尝试可用的代码,但它们都不起作用。这是我了解存储多个复选框值的链接如何插入多个复选框值在数据库中添加多个复选框值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 回答
白衣染霜花
TA贡献1796条经验 获得超10个赞
$checkbox1 = mysqli_real_escape_string($conn, $_POST['potential_escalation'] <-- 你错过了结束圆圈);
添加回答
举报
0/150
提交
取消