[FX.php List] fx/php newbie

Jason H.Awbrey jason at stravinsoft.com
Thu Oct 21 15:36:58 MDT 2004

Hi Nick,

Here is a a simple example of the basics you would need to return a 
found set from FileMaker with FX.php:

//query to retrieve records
$query = new FX($serverIP, $webCompanionPort);
$query->SetDBData("DatabaseName", "LayoutName");
$query->SetDBPassword('password', 'username');
$query->AddDBParam('fieldname', 'value your are searching for');
$query->AddDBParam('related::fieldname', 'test');
$query->AddSortParam('sortField', 'ascend');
$result = $query->FMFind();
$currentKey = key($result['data']);

Then, when you want to loop through the record set:

if ($result['foundCount'] > 0) {
	foreach ($result['data'] as $key => $value) {
		echo $value['fieldName'] . "<br />";

This is pretty basic but it should get you started.

Jason H. Awbrey
StravinSOFT, Incorporated

On Oct 21, 2004, at 4:07 PM, Nick Trenary wrote:

>  I'm just starting to get my feet with php and FileMaker.  Php and FM 
> are both set up correctly.  I have been able to show an array of a 
> search using 'print_r ($results)' .  I understand the concept arrays 
> but am unclear as to how to write the code to print the results on a 
> web page.  Sort of loop will be needed, that I understand too.  But 
> how is the code for the array written to 'cycle' through each record?  
> This is probably a very elementary bit of code but I cannot find any 
> documentation or example for this.  Can anyone steer me in the right 
> direction?
>  Thanks,
>  Nick
>  ----
>  Nick Trenary
>  Computer Information Systems Analyst
> Cedar Rapids Public Library
> Office:(319) 398-5145 x267
>  Work cell: (319) 310-7699
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2371 bytes
Desc: not available
Url : http://www.iviking.org/pipermail/fx.php_list/attachments/20041021/979a0eb3/smime.bin

More information about the FX.php_List mailing list