[FX.php List] simple problem - but stuck

Alex Gates alex at gandrpublishing.com
Wed Oct 25 08:32:35 MDT 2006


Hi Everyone - 

I've had this problem before - - but I don't know how I went about
fixing it.

For some reason, my search will only return the last record when I try
to do a Findall.

Here is the code I am using - - I am trying to display it in a table,
but I only get the latest record.
I'm sure it's a simple solution - but I've run out of ideas.

<table border="1">
<tr>
<td><center><b>TimeStamp</b></center></td>
<td><center><b>Username</b></center></td>
<td><center><b>Web Account #</b></center></td>
<td><center><b>Browser</b></center></td>
<td><center><b>Version</b></center></td>
<td><center><b>Resolution</b></center></td>
</tr>
<?php
	$lookup=new FX($serverIP,$webCompanionPort,'FMPro7');
	$lookup->SetDBData('Web_Cookbook_Dev.fp7','LoginHistory');
	$lookup->SetDBPassword('xxxxxx','xxxxxxxx');
	$lookupResult=$lookup->FMFindall(); 
	$foundResult=$lookupResult['foundCount'];

echo "Error Code: " . $lookupResult['errorCode']; 
echo "<br>Found Count: " . $foundResult;
?>
<?php
foreach( $lookupResult['data'] as $key =>$searchData);
  {
$TimeStamp = $searchData['TimeStamp'][0];
$Username = $searchData['Username'][0];
$WebAccountNumber = $searchData['WebAccountNumber'][0];
$Browser = $searchData['Browser'][0];
$Version = $searchData['Version'][0];
$Res = $searchData['Res'][0];
  
    echo "<tr><td>";    
    echo $TimeStamp;
	echo "<td>" . $Username . "</td>";
	echo "<td>" . $WebAccountNumber . "</td>";
	echo "<td>" . $Browser . "</td>";
	echo "<td>" . $Version . "</td>";
	echo "<td>" . $Res . "</td>";
	echo "</tr>";
  }
	?>
	
  </table>

What am I doing wrong?  What causes only the last record to be
returned??

Thanks for your help...

Alex




More information about the FX.php_List mailing list