[FX.php List] simple problem - but stuck

Chris Hansen chris at iViking.org
Wed Oct 25 08:44:19 MDT 2006


Alex,

Try removing the ';' from the end of this line:

foreach( $lookupResult['data'] as $key =>$searchData);

HTH

--Chris Hansen
   FileMaker 7 Certified Developer
   Creator of FX.php
   "The best way from FileMaker to the Web."
   www.iViking.org


On Oct 25, 2006, at 8:32 AM, Alex Gates wrote:

> 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
>
>
> _______________________________________________
> 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