我是PHP新手。我将在我的数据库中更新我的多检查框feild(CALLS FEATURES)。为了保存多重框,我使用了" implode"然后将其保存在数据库中的一个字段中。但是当数据库只接受有限的复选框(大约13)时,我们不接受它。我不知道为什么。这些是我的代码。
I have defined Features in database =VARCHAR (7000)
if(isset($_POST ['F'])&&!empty($_POST['F'])){
$checkbox = implode(',', $_SESSION ['edit']['checkbox']);
echo $checkbox;
$query_add="UPDATE cars SET Features= '".$checkbox."' WHERE id='".$_SESSION ['edit']['id']."'";
$query_add_run=my`enter code here`sql_query($query_add);
}
enter code here
<form action="finaliseedit.php?page=editreview&ID=<?php echo $_SESSION ['edit']['id'] ?>" method="POST" enctype="multipart/form-data">
<!--FEATURE SECTION-->
<div id="featuremain" style="display: none;">
<div class="features">
<input type="checkbox" name="F[0]" value="Electric sunroof" >Electric sunroof<br/>
<input type="checkbox" name="F[1]" value="Manual sunroof" >Manual sunroof<br/>
<input type="checkbox" name="F[2]" value="Electric windows" >Electric windows<br/>
<input type="checkbox" name="F[3]" value="Satellite navigation">Satellite navigation<br/>
<input type="checkbox" name="F[4]" value="Rear Parking Sensor">Rear Parking Sensor<br/>
<input type="checkbox" name="F[5]" value="Front Parking Sensor">Front Parking Sensor<br/>
<input type="checkbox" name="F[6]" value="Rear Camera">Rear Camera<br/>
<input type="checkbox" name="F[7]" value="Side Camera">Side Camera<br/>
<input type="checkbox" name="F[8]" value="DVD">DVD<br/>
<input type="checkbox" name="F[9]" value="MP3">MP3<br/>
<input type="checkbox" name="F[10]" value="CD Player">CD Player<br/>
<input type="checkbox" name="F[11]" value="CD Changer">CD Changer<br/>
<input type="checkbox" name="F[12]" value="Bluetooth">Bluetooth<br/>
<input type="checkbox" name="F[13]" value="Immobilizer">Immobilizer<br/>
<input type="checkbox" name="F[14]" value="Driver's airbags">Driver's airbags<br/>
<input type="checkbox" name="F[15]" value="Passenger airbags">Passenger airbags<br/>
<input type="checkbox" name="F[16]" value="Side airbags">Side airbags<br/>
</div>
<div class="features">
<input type="checkbox" name="F[17]" value="Leather trim">Leather trim<br/>
<input type="checkbox" name="F[18]" value="Heated Seats">Heathed Seats<br/>
<input type="checkbox" name="F[19]" value="Height adjustable driver's seat">Height adjustable driver's seat<br/>
<input type="checkbox" name="F[20]" value="Height adjustable passenger">Height adjustable passenger<br/>
<input type="checkbox" name="F[21]" value="Folding rear seats">Folding rear seats<br/>
<input type="checkbox" name="F[22]" value="Child seat points (Isofix system)">Child seat points (Isofix system)<br/>
<input type="checkbox" name="F[23]" value="Metallic Paint">Metalic Paint<br/>
<input type="checkbox" name="F[24]" value="Pearlescent paint">Pearlescent paint<br/>
<input type="checkbox" name="F[25]" value="Spare wheel (Full)">Spare wheel (Full)<br/>
<input type="checkbox" name="F[26]" value="Spare wheel (Space-Saver)">Spare wheel (Space-Saver)<br/>
<input type="checkbox" name="F[27]" value="Power steering">Power steering<br/>
<input type="checkbox" name="F[28]" value="Steering wheel rake adjustment">Steering wheel rake adjustment<br/>
<input type="checkbox" name="F[29]" value="Steering wheel reach adjustment">Steering wheel reach adjustment<br/>
<input type="checkbox" name="F[30]" value="Cruise control">Cruise control<br/>
<input type="checkbox" name="F[31]" value="Traction control">Traction control<br/>
<input type="checkbox" name="F[32]" value="Alarm">Alarm<br/>
<input type="checkbox" name="F[33]" value="Roof rails">Roof rails<br/>
</div>
</div>
答案 0 :(得分:0)
我找到了答案。在某些价值观中,我使用的字符如&#34;(&#34;或&#34;&#39;&#34;我不必使用。