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.

Storing filemaker results in PHP session

Featured Replies

The left menu on my website is dynamic and it is based off a recordset from my filemaker database. My left menu is included on every page of my website and I do not want the find of the recordset to occur every time a user browses to a different page. I am looking for a way to store the results in a session so that it only has to look for them once per session. The code that creates my leftbar menu looks like this:

<?php // FMStudio v1.0 - do not remove comment, needed for DreamWeaver support ?>

<?php

$categories_find = $Rackspace->newFindCommand('vehiclesearchsmall');

$categories_findCriterions = array('VehicleCategory'=>'=='.$_SESSION['make'],'VehicleId'=>$_SESSION['model'],'year'=>$_SESSION['year'],);

foreach($categories_findCriterions as $key=>$value) {

    $categories_find->AddFindCriterion($key,$value);

}



fmsSetPage($categories_find,'categories',10000); 



$categories_find->addSortRule('SubCategory2',1,FILEMAKER_SORT_ASCEND); 



$categories_result = $categories_find->execute(); 



if(FileMaker::isError($categories_result)) {$error = 'yes';} else { 



fmsSetLastPage($categories_result,'categories',10000); 



$categories_row = current($categories_result->getRecords());

}



?>



<?php $lis = array();  

foreach ($categories_result->getRecords() as $cer)  {

    $tac = $cer->getField('SubCategory2');

    $lis[$tac] = (!isset($lis[$tac])) ? 1 : $lis[$tac] +1 ;

	

}  

foreach ($lis as $nam => $valu)  {



 echo '<dd class="categories" style="border-bottom:1px dotted #999;"><a href="cilist.php?VehicleCategory='. $_SESSION['make'] .'&SubCategory2=' . $nam . '&VehicleId=' .$_SESSION['model'] . '&year='   . $_SESSION['year']  . '" >' . $nam  .'</a> '. '(' . $valu . ')' . '</dd>';

 

}



 ?>

I tried storing the $categories_row in a session variable but it would only give me one result. I am stuck here any help would be greatly appreciated.

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.