june_c21 Posted March 15, 2010 Share Posted March 15, 2010 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 More sharing options...
abazoskib Posted March 15, 2010 Share Posted March 15, 2010 what do you get when you print_r($_POST)? Link to comment https://forums.phpfreaks.com/topic/195260-passing-array-value/#findComment-1026181 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.