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.

Error message does not appear.

Featured Replies

Using FileMaker Server 11 for a Users database and I have setup a website (using PHP) for people to search the database. Searches (and results) are working properly, but I can't get an error message when no results are found. When this happens, I get the top part of the web page, but then nothing else (the page has a mix of PHP and HTML)...

 

Ideas?

 

(header with stylesheet information removed)

<div id="container">

  <div id="top"><a href="http://medicine.yale.edu/pathology/index.aspx">Yale Department of Pathology</a></div> 

  <!-- end #top -->

  <div id="header">Yale Pathology Directory</div>

  <!-- end #header -->

 

<div id="mainContent">

 

<?php include ("dbaccess.php");

 

$today = date("m/d/y");

$HasLeft = 'No';

$FirstName = $_GET['Users::FirstName'];

$LastName = $_GET['Users::LastName'];

$layout =& $fm->getLayout('Users');

$findCommand =& $fm->newFindCommand('Users');

$findCommand->setRange(0, 400);

$findCommand->addFindCriterion('FirstName', $FirstName);

$findCommand->addFindCriterion('LastName', $LastName);

$findCommand->addFindCriterion('HasLeft', $HasLeft);

 

$findCommand->addSortRule('LastName', 1, FILEMAKER_SORT_ASCEND);

$findCommand->addSortRule('FirstName', 2, FILEMAKER_SORT_ASCEND);

$result = $findCommand->execute();

$records = $result->getRecords();

$unitvalues = $layout->getValueListTwoFields('UnitSubUnit');

 

#Check for an error

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

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

  exit;

}

?>

<table>

<tr>

<td width="250">

<form action="namesearch.php" method="get">

<font size="-1">First:</font> <input id="FirstName" type="text" name="Users::FirstName"/>

<br>

<font size="-1">Last:</font> <input id="LastName" type="text" name="Users::LastName"/>&nbsp;

<input type="submit" name="submit" value="Find"/>

</form>

</td>

<td width="200">

<font size="-1">Unit - SubUnit search:</font>

<form method="get" action="unitsearch.php" name="unitsearch">

<select id="type" name="UnitSubUnit" size="1" onchange="document.forms['unitsearch'].submit();">

<option value=""></option>

<?php foreach($unitvalues as $value) { ?>

<option value="<?php echo $value; ?>"><?php echo $value; ?></option>

<?php } ?>

</select>

</form>

</td>

<td width="100" align="center">

<font size="-1"><a href="http://intranet.yalepath.org/directory/index.php">Home</a></font> 

</td>

</tr>

</table>

<br>

(more code to display search results - a table for the results and then a footer)

 

Brian

Change this portion of your code:

 

#Check for an error

$NoneFoundMsg = '';

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

 if $result->code != 401{ 

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

  exit;

} else {  //code 401 is no records found

$NoneFoundMsg = 'No records found';

}

 

You will have to account for !empty($NoneFoundMsg) when you are displaying your results.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

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.