[FX.php List] FMSkipRecords

Dale Bengston dbengston at preservationstudio.com
Mon Mar 27 09:13:54 MST 2006


Hi Jonathan,

What error are you getting back from FX in $searchResult 
['errorCode']? If it's 401 (no records), I'd suggest wrapping each of  
your search parameters in an if statement to determine whether it's  
blank, and filter out the blank params before you do your FMFind.

Dale

On Mar 24, 2006, at 1:25 PM, Jonathan Foerster wrote:

> Hello!
>
> I am trying to get the FMSkipRecords function to work.  The code  
> below fails to return any records (when there should be several  
> pages worth).
>
> I have stolen much of this code, trying to get something to work  
> (thanks to you, if you unwittingly contributed).  Thanks!
>
> Jonathan Foerster
>
> <?php
> include_once('FX/FX.php');
> include_once('FX/server_data.php');
>
> $Title=$_POST['Title'];
> $Author=$_POST['Author'];
> $Year=$_POST['Year'];
> $Department=$_POST['Department'];
> $Keywords=$_POST['Keywords'];
> $Advisor=$_POST['Advisor'];
> $Records=$_POST['Records'];
> $Sort=$_POST['Sort'];
> $Classification=$_POST['Classification'];
>
> if(isset($_POST['skip'])){ $skipSize=$_POST['skip'];}else 
> {$skipSize='5';}
>
> $search=new FX($serverIP,$webCompanionPort);
> $search->SetDBData('FieldStudies.fp7','Entry', $Records);
> $search->SetDBPassword($webPW,$webUN);
> $search->AddDBParam('Title',$Title,$operator);
> $search->AddDBParam('Author',$Author,$operator2);
> $search->AddDBParam('Year',$Year,$operator3);
> $search->AddDBParam('Department',$Department);
> $search->AddDBParam('Description',$Keywords,$operator4);
> $search->AddDBParam('Advisor',$Advisor,$operator5);
> $search->AddDBParam('Type',$Classification);
> $search->AddSortParam($Sort,'ascend');
> $search->FMSkipRecords($skipSize);
> $searchResult=$search->FMFind();
> ?>
>
>
> <table>
> <tr>
> <td>
> <?php
> if (strlen($searchResult['linkPrevious']) < 1) {
> ?>
> &laquo;- Previous
> <?php
> } else {
> ?>
> <a href="?skip=<?php echo($skipSize) ?>"><strong>&laquo;- Previous</ 
> strong></a>
> <?php
> }
> ?>
> </td>
> <td>
> <?php
> if (strlen($searchResult['linkNext']) < 1) {
> ?>
> Next -&raquo;
> <?php
> } else {
> ?>
> <a href="?skip=<?php echo($skipSize) ?>"><strong>Next -&raquo;</ 
> strong></a>
> <?php
> }
> ?>
> </td>
> </tr>
> </table>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list



More information about the FX.php_List mailing list