Submit Multiple Records using PHP IMPOSSIBLE???
Posted: Fri Apr 06, 2007 10:41 am
Everah | Please use
Process Form
(for one field type)
-Hyrum
Everah | Please use[/syntax]
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Submit Multiple Records using PHP IMPOSSIBLE???
Hi... I've been having a hard time trying to get php to submit multiple records.
First Off... This following form works perfectly when I try to insert multiple rows of one field type - forecast[].
However, I want to submit both - forecast[] and month[] form fields.
HTML Form
[syntax="html"]
<input type=text name=forecast[] value=$forecast> <input type=text name=month[] value=$forecast><BR>
<input type=text name=forecast[] value=$forecast> <input type=text name=month[] value=$forecast><BR>
<input type=text name=forecast[] value=$forecast> <input type=text name=month[] value=$forecast><BR>
<input type=submit>(for one field type)
Code: Select all
<?php
foreach ($_POST['forecast'] as $row=>$name)
{
$monthperiod = "" . $day_oracle[$month] . "-" . $month_oracle[$month] . "-" . '0'. $year;
$forecast = $name;
$query_insert_batch = oci_parse($c, "INSERT INTO FORECAST_INPUT(FORECAST) VALUES ('$name')");
oci_execute($query_insert_batch);
?>Everah | Please use[/syntax]
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]