[FX.php List] Editing multiple records in one submit request (Arrays)

Joel Shapiro jsfmp at earthlink.net
Wed Jun 1 10:47:21 MDT 2005


Hi all

I'm new to FX.php, and I've just joined this List.

I've been exploring FX.php for a little while, using FMWebschool's 
"8-hrs" materials and php.net.  I've got most of the basics down, but 
what I need now is some help with arrays (I think ;-).

I'm working on a report card DB where I've got multiple records (all 
the items on which a student receives a mark, entered via radio 
buttons) that I want to edit all at once via one submit request.  From 
what I've found online, it appears that arrays are what I need to be 
using.  On my first page, I've got the Record_ID attached to the field 
name [in brackets].  However, I don't know how to pull the data from 
the array into my POST and Edit commands on my second page.  I 
understand I need a "foreach" line, but I'm not sure what goes where.

Can anyone point me to some similar file that I can look at, or have 
some other reference or guidance for me?

Thanks very much.

-Joel


--------------------------
This is what I have on my first page, but I don't know how to do the 
foreach statements on the second (response) page.
<?php
   foreach($instanceResult['data'] as $key=>$instanceData)
   {
?>
   <tr>
     <td>
<?php  echo $instanceData['first_name'][0];  ?>:<?php  echo 
$instanceData['RecordID'][0];  ?><input type="text" 
name="field_name[<?php  echo $instanceData['RecordID'][0];  ?>]" 
value="<?php echo  $instanceData['field_name'][0]; ?>"></td>
     <td></td>
     <td><?php  echo $instanceData['RecordID'][0];  ?></td>
     <input type="hidden" name="recid[<?php  echo 
$instanceData['RecordID'][0];  ?>]" value="<?php  echo 
$instanceData['RecordID'][0];  ?>">
   </tr>
<?php
   }
?>
</table>
<input type="submit" name="submit" value="submit">



More information about the FX.php_List mailing list