Can someone please tell me why this date conversion doesn't work? I thought it would. You don't have to fix it unless you want to. I don't mind fixing it myself but I do not understand why it doesn't work. It kinda works if I put in $date[0] or $date [1], etc. Any thoughts? The rest of the page works fine. I didn't show all of it. This is the only part that is not working.
Thanks
Stephen
<?php
if ($submit):
list($m, $d, $y) = explode("/", $date[$y]);
! NOTE ! - It works if I put in $date[0] - it will update all rows with the value entered in the date form on Row #1
If I put $date[1] - it will update all rows with the value entered in Row #2, etc.
$sql = "INSERT INTO tblData (EID, CID, SID, Date, Time, Description) VALUES";
for ($y=0; $y<count($cid); $y++)
{
if ($y == 0)
$sql .= "('$id', '$cid[$y]','$sid[$y]','$y-$m-$d','$time[$y]','$desc[$y]')";
else
$sql .= ", ('$id', '$cid[$y]','$sid[$y]','$y-$m-$d','$time[$y]','$desc[$y]')";
}
?>
<!-- Row #1 -->
<TR>
<TD width= 10></TD>
<TD><input type="text" name="cid[]" .../></TD>
<TD><selinput type="text" name="sid[]" .../></TD>>
<TD><input type="text" name="date[]" .../></TD>
<TD><input type="text" name="time[]" .../></TD>
<TD><input type="text" name="desc[]" .../></TD>
</TR>
<!-- Row #2 -->
<TR>
<TD width= 10></TD>
<TD><input type="text" name="cid[]" .../></TD>
<TD><selinput type="text" name="sid[]" .../></TD>>
<TD><input type="text" name="date[]" .../></TD>
<TD><input type="text" name="time[]" .../></TD>
<TD><input type="text" name="desc[]" .../></TD>
</TR>
<!-- Row #3 -->
etc.
<!-- Row #4 -->
etc.
<... submit >.... etc.