Jump to content

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

Recommended Posts

  • Newbies
Posted

I have a FM7 layout that has demographic data from one table (contacts)

First_Name

Last_Name

It has address and phone info from two other tables (contact and address) in this layout. These are both 1-many relations based on a contact_id.

I can display all data and update data from the

contact table. I cannot update data from the

dependent tables.

Using print_r() the layout data looks like

[First_Name] => Array

(

[0] => Rich

)

[Last_Name] => Array

(

[0] => Gregory

)

[uIP_Contact_Address::Address_Type] => Array

(

[0] => Local Address

[1] =>

[2] =>

[3] =>

)

[uIP_Contact_Address::Address_Street1] => Array

(

[0] => 1630 Secretarys Road

[1] =>

[2] =>

[3] =>

)

I have the

set up so that the address fields are arrays, like this code snippet:

Local Address

Street Line 1

Street Line 2

City/State/Zip

Country:

which is created from this PHP snippet

$address_array =

array( "Local Address",

"Permanent Address", "Summer Address", "Aux Address");

$maxsize = sizeof( $address_array);

$data_array = $instanceData['UIP_Contact_Address::Address_Type'];

for ($i = 0; $i < $maxsize; $i++)

{

if( strlen( trim(

$instanceData['UIP_Contact_Address::Address_Type'][$i])) > 0)

{

// display DB value

$mykey = $i;

echo "

" . $address_array[$i] . "�n";

echo "

Street Line 1" .

"

"value='" . $instanceData['UIP_Contact_Address::Address_Street1'][$mykey] .

"'>

n";

echo "

Street Line 2" .

"

"value='" . $instanceData['UIP_Contact_Address::Address_Street2'][$mykey] .

"'>

n";

echo "

City/State/Zip" .

"

" .

"

"value='" .

$instanceData['UIP_Contact_Address::Address_City'][$mykey] . "'>n ";

echo "

"value='" .

$instanceData['UIP_Contact_Address::Address_State'][$mykey] . "'>n ";

echo "

"value='" .

$instanceData['UIP_Contact_Address::Address_Zip'][$mykey] . "'>n ";

echo "Country: " .

"

"value='" .

$instanceData['UIP_Contact_Address::Address_Country'][$mykey] . "'>n " .

"

n";

} // found in db

I echo all the correct data in the action PHP program that does the FMEdit().

I just cannot find the syntax to update the child

records. The parent record is updated fine with

$editData->AddDBParam( '-recid', $recID);

$editData->AddDBParam('First_Name', $First_Name);

$editData->AddDBParam('Last_Name', $Last_Name);

The complete PHP code for the display of the data in a form and the handler program is found in

http://128.143.31.105/php8/uip/fmforum.help.zip

thanks

rich

This topic is 6777 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.