[FX.php List] "No Action Taken" on query

Tim 'Webko' Booth tim.webko at gmail.com
Tue Jan 12 14:15:27 MST 2016


The one I generally use just for testing the first place (so could be
adapted to do other things if used on a cronjob or similar):

<?php

include_once('include/db_config.php'); // DataBase Configuration File.
include_once('include/FX/FX.php'); // FX.php file


//Simple server tests
$_SESSION['serverError'] = ""; // reset server error
//Check if Port 80 works at all
if( !fsockopen ($dbHost, 80, $errno, $errstr, 2) ) {
$_SESSION['serverError'] = "Server not up";
} else {
//Check -dbnames
/* $pageObj = new FX($dbHost,$port,$dbType,$conType);
$pageData = $pageObj->DoFXAction('view_database_names');*/
//Check if a findany to an available table works
$pageObj=new FX($dbHost,$port,$dbType,$conType);
$pageObj -> setDBPassword($dbPass,$dbUser);
$pageObj -> setDBData($dbName,'LAYOUT', 'all');
$pageData = $pageObj -> FMFindAny();
if (FX::isError($pageData)) {
echo $pageData->getMessage();
echo "<br />";
var_dump($pageData);
}
elseif ($pageData[‘errorCode’] != 0) {
$_SESSION['serverError'] = $pageData['errorCode'];
echo "A FileMaker error occurred ({$pageData[‘errorCode’]})";
}
else {
   var_dump($pageData);
echo "All is well";
}
}
if ($_SESSION['serverError'] != "0") {
echo "Error: ".$_SESSION['serverError'];
}
?>

On 13 January 2016 at 06:17, Bob Patin <bob at patin.com> wrote:

> Well… here’s what I’m doing—maybe you can tell me where my error is.
>
> I have a page that checks all of my FM Servers to see that the WPE is up;
> it reloads the page every 4 minutes:
>
> After my query I’m running this (I forget who gave this to me):
>
> // is server up?
> if( !fsockopen ($server, 80, $errno, $errstr, 2) ){
> // does a bunch of page formatting here for the display
> }
>
> I’ll try swapping that out for
>
> if (FX::isError($qResult)){
> // do stuff
> }
>
> So my question is this: if the WPE is down, FX isn’t going to return
> anything, is it? SO, assuming I just did a query, returning the results to
> $qResult, what do I look for to be returned when the WPE doesn’t respond? I
> always thought that, if WPE is down, nothing gets returned at all…
>
> Last question: is there an advantage to using FX::isError() to something
> like this:
>
> if ($qResult[‘errorCode'] != 0
>
> ? I think you told me once that FX::isError waits for the query to finish
> before it is invoked; wouldn’t that be the same thing with my little IF
> statement above? Is the first method better, or just simpler?
>
> Thanks,
>
> Bob
>
> Bob Patin
> Longterm Solutions
> bob at longtermsolutions.com
> 615-333-6858
> FileMaker 9, 10, 11, 12 & 13 Certified Developer
> http://www.longtermsolutions.com
> -
> iChat: bobpatin at me.com
> Twitter: bobpatin
>> FileMaker Consulting
> FileMaker Hosting for all versions of FileMaker
> PHP • Full email services • Free DNS hosting • Colocation • Consulting
>
>
>
> On Jan 12, 2016, at 11:10 AM, Chris Hansen <chris at iViking.org
> <chris at iviking.org>> wrote:
>
> Hey Bob,
>
> Glad to hear you got that figured out.
>
> As for knowing when the WPE is down, if you're checking FX::isError() --
> and if you're using FX you should be -- that should give you some
> indication, since there should be an error from attempting to connect to
> the server.  Additionally, I seem to recall that others on the list have
> posted methods that they use to check server health; could some of them
> chime in here?
>
> Best,
>
> --Chris
>
> On Jan 12, 2016, at 7:30 AM, Bob Patin <bob at patin.com> wrote:
>
> Chris,
>
> I finally found the issue; the client had provided an incorrect server
> address.
>
> So, and I think I’ve asked this before, do you have a way that, if an FX
> query fails because the WPE is down, that it’ll return an error?
>
> Thanks,
>
> Bob Patin
> Longterm Solutions
> bob at longtermsolutions.com
> 615-333-6858
> FileMaker 9, 10, 11, 12 & 13 Certified Developer
> http://www.longtermsolutions.com
> -
> iChat: bobpatin at me.com
> Twitter: bobpatin
>> FileMaker Consulting
> FileMaker Hosting for all versions of FileMaker
> PHP • Full email services • Free DNS hosting • Colocation • Consulting
>
> On Jan 11, 2016, at 10:22 PM, Chris Hansen <chris at iViking.org
> <chris at iviking.org>> wrote:
>
> Bob,
>
> Usually when you see that error, it means that somehow an action (like
> FMFind) was never reached in the code.  Is there something in your code
> that could be stopping things before you get to the final call, or did you
> omit one?
>
> Best,
>
> --Chris
>
> On Jan 11, 2016, at 1:45 PM, Bob Patin <bob at patin.com> wrote:
>
> Does this indicate that FX is failing to communicate w/ the Filemaker
> Server?
>
> Thanks,
>
> Bob Patin
> Longterm Solutions
> bob at longtermsolutions.com
> 615-333-6858
> FileMaker 9, 10, 11, 12 & 13 Certified Developer
> http://www.longtermsolutions.com
> -
> iChat: bobpatin at me.com
> Twitter: bobpatin
>> FileMaker Consulting
> FileMaker Hosting for all versions of FileMaker
> PHP • Full email services • Free DNS hosting • Colocation • Consulting
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
>
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
>
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
>
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
>
>
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20160113/363d7ff4/attachment-0001.html


More information about the FX.php_List mailing list