I want insert multiple checkbox values in Mysql using PDO.
HTML Form part checkbox
<form action="insert.php">
<label>
<input name="check[]" id="check[]" type="checkbox" value="<?=$row['id']?>" />
<span class="lbl"></span>
</label>
<button type="submit" name="send" id="send" >
</form>
PHP Part insert
$checkbox = $_POST['check'];
for (i$=0; $i<sizeof($checkbox);$i++)
$insert = $pdo->prepare("INSERT INTO table (check_value) VALUES (?)");
$insert->execute(array(".$checkbox[$i]."));
More when i use ".$checkbox[$i]." give "Notice: Array to string conversion"
phppart? I believe this is supposed to be in a loop coming from a database.forattribute