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

Hi,

I've just started learning PHP and just finished running through the Filemaker PHP API turorial. I'm trying to apply what I just learned to a custom website and I'm having some troubles connecting to my Filemaker Database.

What I am trying to do is to get all records on a specific table to be displayed and I get the following error, "fatal error: call to a member function getField() on a non-object - on line 63" and I'm not sure where I went wrong. I'm sure its something simple as I am quite new to PHP.

My php code is as follows:

<?php

$findcommand =$fm->newFinallCommand('Recipes');

$result = $findCommand->execute();

if (FileMaker::isError($result)) {

echo "<p>Error: " . $result->getMessage() . "</p>;

exit;

}

$record = $records[0]

$recpipe = $record-getField('Recipe_Name');

?>

Thanks In advance for the help,

Chris

You're missing some code... You're not actually setting the $records variable anywhere.

You might want to turn notices on in php to make this more obvious (http://php.net/manual/en/function.error-reporting.php).

<?php



$findcommand =$fm->newFindAllCommand('Recipes');



$result = $findCommand->execute();



if (FileMaker::isError($result)) {

echo "<p>Error: " . $result->getMessage() . "</p>;

exit;

}



// MISSING 

$records = $result->getRecords();

//End Missing[/size][/color]

[color="#1C2837"][size="2"]

$record = $records[0];



$recpipe = $record->getField('Recipe_Name');



?>

  • Author

Awesome! Thanks Genx. Works like a charm. Thanks for the link too that should prove to be rather useful as I learn.

Much appreciated,

Chris

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.