Forum Moderators: coopster

Message Too Old, No Replies

Submit Multiple Records using PHP IMPOSSIBLE?

Submit Multiple Records using PHP IMPOSSIBLE?

         

hdogg

3:37 pm on Apr 6, 2007 (gmt 0)

10+ Year Member



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

<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>

Process Form
(for one field type)
<?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);
?>

-Hyrum

cmarshall

3:57 pm on Apr 6, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What kind of errors are you experiencing?

jatar_k

4:06 pm on Apr 6, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld hdogg

it looks like you are only actually doing single inserts in a loop

can you describe what exactly is happening