Jump to content

Passing Array Value


june_c21

Recommended Posts

Hi ,

 

I try to pass these array value to another php script but no data in the database except for 'status' and 'id'. can someone tell me what's wrong with my code ?

 

<?php
include './includes/header.php';

for ($i=1;$i<11;$i++)
{
$id = $_GET ['id'];
$causes = $_POST ['causes'][$i];
  $corrective_action = $_POST ['corrective_action'][$i];
  $name = $_POST ['name'][$i];
  $date = $_POST ['date'][$i];
  $remarks = $_POST ['remarks'][$i];
   $status = $_POST ['status'];
echo $causes;
//$query= "INSERT INTO corrective_action( id, causes, corrective_action, name, date, remarks ) VALUES ('$id','$causes','$corrective_action','$name','$date','$remarks') ";
//$result = mysql_query($query,$dblink);


}

$query1= "UPDATE event SET status= '$status' where id=$id ";
$result1 = mysql_query($query1,$dblink);

?>



Link to comment
https://forums.phpfreaks.com/topic/195260-passing-array-value/
Share on other sites

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.