Jump to content
Server Maintenance This Week. ×

updating repeating field with AddDBParam


This topic is 6469 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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

Link to comment
Share on other sites

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++;

}

Link to comment
Share on other sites

This topic is 6469 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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