Jump to content

Pb with function getRecordById


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

Recommended Posts

  • 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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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