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.

Pb with function getRecordById

Featured Replies

  • Newbies

Dear Sirs,

I'm learning API for FMP with some examples, then I have

always the problem with function getRecordById, particularity

the variable " recid ", it returns always error :)

Undefined index: recid

when I used

$record = $fm-> getRecordById ('Layout1', $_GET['recid']);

or empty($_REQUEST['recid'] = TRUE !

Here are the examples :(

<?php

define( 'FM_HOST', '127.0.0.1' );

define( 'FM_FILE', 'Test' );

define( 'FM_USER', 'php' );

define( 'FM_PASS', 'php' );

require_once ('FileMaker.php');

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

$record = $fm-> getRecordById ('Layout1', $_GET['recid']);

$id = $record->getField('ID');

..............

or

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

if (empty($_REQUEST['recid'])) {

die('The record id is missing.');

}

................

Would you like to tell me where is the value of "recid"

and how do I define it ?

Thanks in advance for the help!

Andy

1) does it return an error or a notice?

2) You should probably use $_POST or $_GET rather than $_REQUEST.

Given that you are using $_REQUEST though, you can either tack the record id onto the end of your url e.g.:)

myPHPpage.php?recid=12

OR you can construct an HTML form:

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.