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.

Continue After Error is found...

Featured Replies

I have a PHP script that is 3 separate FileMaker finds show 3 separate tables of results. I am having trouble when one of finds returns no records, in this case the while script dies (but I am not telling the script to die anywhere).

here is the important code where I know its breaking but I'm not sure how to make it move on.


....

$result = $request->execute();



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

	

	$apps_html = '<p>(No Pending records found.  Records will be displayed here)</p>';

	}else{  .... bunch of code.....



$request2 = $FMDB->newFindRequest('fm_layout');

....

....

$result2 = $request2->execute();



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

	

	$apps_html = '<p>(No Pending records found.  Records will be displayed here)</p>';

	}else{  .... bunch of code.....

...



$request3 = $FMDB->newFindRequest('fm_layout');

....

....

$result3 = $request3->execute();



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

	

	$apps_html = '<p>(No Pending records found.  Records will be displayed here)</p>';

	}else{  .... bunch of code.....

...







Any suggestion on make the script move on to request 2 if request 1 has no records found would be much appreciated.

The only problem I can see with the code you posted is that the 'else' block is not closed. My assumption is that happened when trimming the code down to post here; is that correct? (are your 'else' block's closed in your actual php file?)

What error are you getting?

On your development computer, it's best to have error's shown by default (set in php.ini), but you can also enable it in your script with...


ini_set("display_errors","on");

error_reporting(E_ALL^E_NOTICE); // this may also have to be E_ALL^E_NOTICE^E_DEPRECATED depending on what version of php you're running.

(Thanks Genx, for those lines of code)

  • Author

I'm not getting a PHP type error. All the existing code is working. I may have been unclear on the results that I want to see.

If request1 returns no records my

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

	

	$apps_html = '<p>(No Pending records found.  Records will be displayed here)</p>';

	}




Works perfectly but if that happens on the first of my 3 requests that it does not move on to request 2 and 3 to show me those results.   I need it to show me 3 sets of records or 3 messages saying no records found or any combination of the 3.  



kind of like 



Request 1

    No records found



Request 2 

     Record  22

     Record  898

     Record  653





Request 3

    Record......





but right now in this example I doesn't show many anything for request 2 or 3 if  request 1 has no records.



The only problem I can see with the code you posted is that the 'else' block is not closed. My assumption is that happened when trimming the code down to post here; is that correct? (are your 'else' block's closed in your actual php file?) What error are you getting? On your development computer, it's best to have error's shown by default (set in php.ini), but you can also enable it in your script with...

(Thanks Genx, for those lines of code)


ini_set("display_errors","on");

error_reporting(E_ALL^E_NOTICE); // this may also have to be E_ALL^E_NOTICE^E_DEPRECATED depending on what version of php you're running.

In that case, maybe your request2 and request3 blocks of code are in the first 'else' block. Are all your 'else' blocks closed as in this code below?


....

$result = $request->execute();



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

	$apps_html = '<p>(No Pending records found.  Records will be displayed here)</p>';

}else{

	.... bunch of code.....

}// ADD THIS CLOSING BRACKET



$request2 = $FMDB->newFindRequest('fm_layout');

....

....

$result2 = $request2->execute();



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

	$apps_html = '<p>(No Pending records found.  Records will be displayed here)</p>';

}else{

	.... bunch of code.....

}// ADD THIS CLOSING BRACKET



$request3 = $FMDB->newFindRequest('fm_layout');

....

....

$result3 = $request3->execute();



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

	$apps_html = '<p>(No Pending records found.  Records will be displayed here)</p>';

}else{

	.... bunch of code.....

}// ADD THIS CLOSING BRACKET

....

Just a note on this - trimming the code to the point where it's not readable and .......ing out key peices of information is not a good idea.

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.