Hi
If I have a form that submits 3 arrays called date[], price[] and type[] how can I loop through these using one loop to update the data into my database.
i.e. foreach($POST["date"] As $val){
$result = mysql_query("UPDATE pricecode".$pricecodetable." SET textdate = '".$date."', price = '".$price."', type = '".$type."' WHERE pricecodeID = '".$pricecodeID."'", $link_id) or die(mysql_error());
}
foreach($POST["price"] As $val){
$result = mysql_query("UPDATE pricecode".$pricecodetable." SET textdate = '".$date."', price = '".$price."', type = '".$type."' WHERE pricecodeID = '".$pricecodeID."'", $link_id) or die(mysql_error());
}
foreach($_POST["type"] As $val){
$result = mysql_query("UPDATE pricecode".$pricecodetable." SET textdate = '".$date."', price = '".$price."', type = '".$type."' WHERE pricecodeID = '".$pricecodeID."'", $link_id) or die(mysql_error());
}
would obviously not be right but how do I do it?
Help appreciated