I need to insert more than one values in checkbox but now it is seemed to be only the last value am entering is inserting to database.
this is my HTML code
Your problem is likely:
You have multiple checkboxes.
And you want to insert all of them into database.
You need to loop your posted checkboxes.
Your problem is likely that you are not looping over the $_POST['product']
, so, only, the last product is inserting into database.
So, your checkboxes:
">
The code for posted file:
if (! empty($_POST['product'])) {
foreach ($_POST['product'] as $product) {
// Here, you insert $product into database.
}
}