Jump 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.

filemaker.php.. refer to each table as separate object?

Featured Replies

hello..

so, i'm making my way (stumbling through) using the Filemaker API.. and i'd like to clarify something in my head before i get to used to the idea, in case it's the 'wrong' way.

:o I thought i could get a related field from the "Meeting" table field by doing:


define ('FM_HOST', '127.0.0.1');

define ('FM_FILE', 'rxworldwide');

define ('FM_USER', '******');

define ('FM_PASS', '******');



include ('Filemaker.php');



###### CONNECT TO DATABASE

$fm = new FileMaker (FM_FILE, FM_HOST, FM_USER, FM_PASS);



###### GET ATTENDEE RECORD

$attendee = $fm->getRecordById('Attendee Setup', NULL);  // i'll fix the null thing later



##### GET MEETING RECORD

$meeting = $fm->getRecordById('Meeting Setup', NULL); // ditto





Originally, i had a "Web" layout containing fields from both the Attendee table and related fields from the Meeting table.. but i couldn't get the related fields to appear on the web.



Now, to pull an attendee field.. i just:




<?php echo $attendee->getField('attendee name') ?>




And to get a meeting field on the same page.. i'm doing:




<?php echo $meeting->getField('meeting name') ?>




It's working this way (above), but i wanted to make sure i wasn't developing any bad habits right out of the gate. 
<?php echo $attendee->getField('Meeting::meeting name') ?>

no dice.. i don't know if it's not /supposed/ to work that way, or if i'm just thinking about this all wrong(?).

any guidance would be greatly appreciated. :)

see my other post . The short of it is that a you need to use the 'relationship name' i.e. the name of the Table Reference in FMP's relationship graph which my not be the same as the Table name.

Also if your related table is in a portal you will need to grab the related set before you can access the fields. (even if the portal just contains one row.)


$relatedRecords = getRelatedSet('relationship_name');

Will return an array of Filemaker_Record Objects that you can loop through and grab fields from;

Edited by Guest

Create an account or sign in to comment

Important Information

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

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.