[FX.php List] simple problem - but stuck
Derrick Fogle
derrick at fogles.net
Wed Oct 25 08:40:02 MDT 2006
What is your "$foundResult" variable returning? Your code is missing
a closing </td> tag after outputting $TimeStamp, but that shouldn't
cause the problem you're seeing.
On Oct 25, 2006, at 9: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
Derrick Fogle
derrick at fogles.net
More information about the FX.php_List
mailing list