Jump to content

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

Recommended Posts

Posted

I am new to FX.php and I have only worked with php (never created any) and I can't seem to get FX.php to communicate with our FMServer Advance. Instead, I get a weird error that points to a line of code on my test php page. Here is the scenario:

I am trying to test connectivity with fx and our Filemaker server advance machine by doing a simple find all with a test php page. The code I am using looks like this:

<html>

<head>

<title>Untitled Document</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

</head>

<body>

<?php

include_once('FX/FX.php');

include_once('FX/FMErrors.php');

include_once('FX/server_data.php');

$groupSize='50';

$findall=new FX($serverIP,$webCompanionPort,'FMPro7');

$findall->SetDBData('web.fp7','web',$groupSize);

$findall->SetDBPassword('password','fmsadmin');

$findallResult=$findall->FMFindall();

echo $findallResult['errorCode'];

foreach($findallResult['data'] as $key=>$findallData);

?>

<html>

<head>

</head>

<body>

<br></body>

</html>

</body>

</html>

When I access this page from my web browser I get the following error:

Warning: Cannot use a scalar value as an array in /Library/WebServer/Documents/test1.php on line 27

Warning: Invalid argument supplied for foreach() in /Library/WebServer/Documents/test1.php on line 27

Does anyone have a clue as to what this means?:

I have installed the FX software on two OS X machines - one running 10.4 and Apache 1.3.33 another the other running 10.2.8 with Apache 1.3.29 - neither one of the machines are able to do the simple find query to our FileMaker Server (Version 7.0.3). I have followed the FX instructions to the letter, in fact, I have even reinstalled FileMaker server (per FX tech supports recommendation) and the queries still do not work. The error is the same on both computer configurations.

Any help is greatly appreciated!!!

-Van

Posted

What happens if you replace the line:

foreach($findallResult['data'] as $key=>$findallData);

with:

print_r($findallResult['data']);

I would place the top part of the html (i.e. from <html> to <body>) before the php. So that you can use echo and print_r within the body of the page.

Good Luck.

Garry

Posted

I tried the code you suggested, but im not sure what you mean by:

"I would place the top part of the html (i.e. from <html> to <body>) before the php. So that you can use echo and print_r within the body of the page."

There are several <html> to <body> tags and I not sure where or what I should move around. When I run the page as is, I don't get the scalar error anymore, I just get a blank page. I would like to see some type of output to ensure I have a good connection to my FMServer.

Thanks for the help.

-Van

  • 6 months later...
  • Newbies
Posted

I had a similar problem when I initially set up FX.php. At the time I was running PHP 4.x.x (can't remember which exactly) and when I updated to PHP 5.0.4 it resolved the problem and I no longer get that error message.

Hope that helps.

Cheers, Chris

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