[FX.php List] Updating repeating field with AddDBParam
Chris Hansen
chris at iViking.org
Wed Aug 9 10:58:08 MDT 2006
Jack,
You're very close if I'm remembering correctly. Of course, as with
any edit you need to specify the Record ID of the record that you're
modifying. For the individual repetitions, however, you need to
specify which repetition to edit. In FileMaker 5/6 this was done by
appending ".repNo" to each edit. So, your loop would look like this:
$i = 1;
foreach ($_POST['viewTypes'] as $key => $value) {
$imageQuery->AddDBParam('View Type.' . $i, $value);
$i++;
}
I'm not 100% sure of that, but I think it's right. As I recall the
"FieldName(RelRecID).RepNo" syntax was new with FM7. It does make
sense though, since the old way doesn't allow for repeating fields
within portals. Let me know if this doesn't solve your problem and
I'll dig some more...
Best,
--Chris Hansen
FileMaker 7 Certified Developer
Creator of FX.php
"The best way from FileMaker to the Web."
www.iViking.org
On Aug 9, 2006, at 7:05 AM, Jack Kelly wrote:
> Folks,
>
> I've just started using the FX.php module and I'm having trouble
> finding info regarding how to properly qualify updating a repeating
> field when working with FM5/6.
>
> I tried just specifying the same parameter and repeating the value
> thinking it would understand that the same field indicated a
> repeating value which did not work:
>
> ...
> foreach ($_POST['viewTypes'] as $key => $value) {
> $imageQuery->AddDBParam('View Type',$value);
> }
> ...
>
> And I tried using a format based on what the documentation said was
> needed when working with FM7 repeating/portal fields which does not
> work:
>
> ...
> $i = 1;
> foreach ($_POST['viewTypes'] as $key => $value) {
> $imageQuery->AddDBParam("View Type($i)",$value);
> $i++;
> }
> ...
>
> I tried the above with i=0 and i=1. And tried adding ".$recId"
> after the ($i). Neither worked.
>
> Does anyone know how I correctly specify repeating fields using the
> AddDBParam method with a FM5/6 database?
>
> Thanks in advance,
> Jack_______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
More information about the FX.php_List
mailing list