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.

Featured Replies

Hey gang,

I've taken the plunge and have taken FM to the web, or at least I'm making good progress in that direction. I'm using PHP 5 with FX.php on Windows XP with the IIS server. I'm Using FM6 Pro for testing and learning at the moment, but will switch to FM7 Advanced Server once it comes out...

I'm working through chapter 8 of Bob Bowers and Steve Lane's book "Advanced FileMaker Pro 6 Web Development." Having really good success, but am stuck at p 292. I'm trying to use the FX.php FMEdit() to edit an existing record. I understand that this command works only on a single record at a time, based on the -recid. I can find a single record using FMFind(), returning the data to a variable, $MyResult.

However, it doesn't appear that the -recid is a part of the $MyResult array. So:

1: How do I find the -recid

2: How do I parse it out of the array so that I can use it with FMEdit() (That is, what is the syntax for referencing array elements so I can find -recid?)

Thanks,

Dan

Dan,

You can pick off the recID similar to this snippet I am including below. This particular one using an FMNew() function.

The recID (and modID) can be snagged in the same way from an FMFind() before you perform the FMEdit().

If I am editing an existing record, I will do the FMFind, grab the recID and stash it in a session variable. Then, if the user edits (updates) the record, I have the recID ready to use when calling FMEdit().

Hope this helps!

regards... Bob Minteer

- - - Snippet from one of my pages - - - - -

$update = new FX ($FMAddress,$FMPort);

$update->SetDBData ('remarks.fp5', 'raw', 1);

$update->SetDBPassword ($syspassword, $sysusername);

$update->AddDBParam ('MagicNumber', $recordID);

$update->AddDBParam ('Summary', $_POST['summary']);

$update->AddDBParam ('RemarkText', $_POST['moreinfo']);

$update->AddDBParam ('Operator', $sessUserName);

$result=$update->FMNew();

// Change the mode so that we will see the add note button.

$sessCurFunc = "view";

if($result['errorCode']!=0){

echo "Error Code Returned: " . $result['errorCode'] . "<br>n";

exit;

}

$recKey = key($result['data']);

$recordPointers = explode (".",$recKey); // where $key is the current key from $ReturnedData['data']

$recID = $recordPointers[0]; // here's the RecordID

$modID = $recordPointers[1]; // and here's the ModifyID

- - - - - - - - - - - - - - - - - - -

  • Author

Perfect! I didn't realize that that's how the RecID and ModID were passed back. After doing some more reading about arrays last night, this all makes sense.

Thanks so much. Glad you've joined the Formus, Bob.

Dan

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.