Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

updating repeating field with AddDBParam

Featured Replies

Folks,

I've just started using the FX.php module and I'm having trouble finding anything in its documentation 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 with i=0 and i=1. Neither worked.

Does anyone know how I correctly specify repeating fields using the AddDBParam method with a FM5/6 database?

Thanks in advance,

Jack

  • Author

I got the solution from the FX.php mailing list after getting onto that. So I thought I'd post it hear for anyone else that my have a need for this.

The correct form for updating repeating fields with FM 5/6 is


$i = 1;

foreach ($_POST['viewTypes'] as $key => $value) {

	$imageQuery->AddDBParam("View Type.$i",$value);

	$i++;

}

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.