inserting multiple data form checkbox into mysql
-1
I have try for this code, but why the result is looping count for ex : choose 3 checkbox and will 9 data inserting into database and which 6 is double data..need help thank you for($count = 0; $count<count($_POST["checkbox_value"]); $count++) { foreach($_POST['checkbox_value'] as $check) { $values = explode('|', $check); $NameItem = $values[0]; $CodeItem = $values[1]; $ItemDesc = $values[2]; $ItemPrice = $values[3]; $query .= 'INSERT INTO item(item_name, item_code, item_description, item_price) VALUES("'.$NameItem.'", "'.$CodeItem.'", "'.$ItemDesc.'", "'.$ItemPrice.'"); ';} }
m...