Insertion is happening when html table row is empty.if any of the input field has value allow to insert otherwise dont insert blank row to database.Where i need to change my code?MY datas are inserting if table row of datas are null
php code
for ($count = 0; $count < count($itemname); $count++) {
$itemname_clean = mysqli_real_escape_string($link, $itemname[$count]);
$unit_clean = (int) $unit[$count];
$quantity_clean = (int) $quantity[$count];
$rate_clean = $rate[$count];
$totamount_clean = $totamount[$count];
$checkvat_clean = $checkvat[$count];
if ($itemname_clean != '' || $unit_clean != '' || $quantity_clean != '' || $rate_clean != '' || $totamount_clean != '') {
$query .= '
//insert query goes here
}
}