I use 4 input boxes with same name.I will fill only one input box at a time and insert in DB using php.But doing following method inserts three empty records along with value-filled 4 th record.Need help!
Html
<input type="text" name="abc[]" id="abc" value="">
<input type="text" name="abc[]" id="abc" value="">
<input type="text" name="abc[]" id="abc" value="">
<input type="text" name="abc[]" id="abc" value="">
Php
$abc = $_POST['abc'];
if (is_array($abc)) {
foreach($abc as $c) {
$insert="INSERT INTO item(productid) VALUES ('$c')";
$insert2=mysql_query($insert); }
}