I have a form that submits information to my MySQL database>table. Some of the information is collect via Checkboxes. I want the contents of any chosen checkbox to be applied to only one field in my table. I have tried so many methods, I just can't get it working. I think it all come down to Implode() but I'm stuck on its implementation.
Here's what I've done so far; form.php
Code: Select all
<form enctype="multipart/form-data" action="insert.php" method="post">
<input type="checkbox" name="facilitiesї]" value="Clubhouse">
Clubhouse<br>
<input type="checkbox" name="facilitiesї]" value="Holiday caravan hire">
Holiday caravan hire<br>
<input type="checkbox" name="facilitiesї]" value="Games room">
Games room<br>
<input class="formblockgrey" type="submit" name="submit" value="Add Details">
</form>Code: Select all
<?php
include("connector.php"); //usual mysql connect stuff
$query = "INSERT INTO hotel (facilities)
VALUES('".$_POST['facilities']."')";
$result = mysql_query($query);
?>