I need your help, I have this table Fiddle ( the real table has another 4 providers columns, six in total) and I need some array for insert into a DB, I been trying with this:
$rowb = array();
$i = 1;
while (isset($_POST["prov_name$i"])) {
$rowb[] = array($_POST["prov_name$i"],$_POST["unitval$i"], $_POST["totval$i"]);
$i++;
}
foreach ($rowb as $row) {
$query = 'INSERT INTO provprices (CA_id, prov_name, unitval , totval)
VALUES ("'.$CA_id.'","'.$row[0].'","'.$row[1].'","'.$row[2].'")';
mysql_query($query) or die(mysql_error());
}
But i think, need another increment letter next to $i, hope you can understand me. Thanks!