Jump to content

Submit Multiple Records using PHP IMPOSSIBLE???


hdogg

Recommended Posts

 

 

 

 

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

 

<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

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.