Siggles Posted February 18, 2009 Share Posted February 18, 2009 Any ideas will this will not work... case "updateinv": foreach ($_POST['markedinv'] as $key => $val){ echo "Key: $key; Value: $val<br />\n"; $query = mysql_query("UPDATE timesheet SET marked_invoiced='1' WHERE log_id = '$val' "); } foreach ($_POST['cat'] as $key2 => $val2){ echo "Key: $key2; Value: $val2<br />\n"; $query2 = mysql_query("UPDATE timesheet SET marked_invoiced='0' WHERE log_id = '$val2' "); } but this will case "updateinv": foreach ($_POST['markedinv'] as $key => $val){ echo "Key: $key; Value: $val<br />\n"; $query = mysql_query("UPDATE timesheet SET marked_invoiced='1' WHERE log_id = '$val' "); } The echos work for both arrays so I know they exist. Link to comment https://forums.phpfreaks.com/topic/145775-2-x-foreach-will-not-work/ Share on other sites More sharing options...
Mchl Posted February 18, 2009 Share Posted February 18, 2009 try echoing mysql_error to see if query fails (and what is the reason) Link to comment https://forums.phpfreaks.com/topic/145775-2-x-foreach-will-not-work/#findComment-765382 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.