php - Iterating through FileMaker record set -
php - Iterating through FileMaker record set -
i'm new @ filemaker , trying info out via api. issue i'm having when create newfindcommand , execute resulting record set contains many rows there in layout each row same. more specifically, each row re-create of first row in database.
e.g. i'm looking products product code 'xxx', of there should 7. 7 rows each 1 same product.
i've looked couple of tutorials online , same operations i'm lost why results come out way.
this code problem. haven't been able track cause myself yet.
$findcommand = $productsfm->newfindcommand($productslayout); $findcommand->addfindcriterion('product code', 'xx123'); $findcommand->addsortrule('product code', 1); $result = $findcommand->execute(); if (filemaker::iserror($result)) { echo "<p>error: " . $result->getmessage() . "</p>"; exit; } $records = $result->getrecords(); foreach($records $record) { echo $record->getfield('product id'); // same code each iteration here }
any advice?
edit: layout $productlayout mentioned above refers items layout. here brief breakdown of er diagram items table. table: items family id item id guid
table: item options item id description guid
table: pricing ~ item family id item id item alternative qty
table: quantity qty item id guid
i fixed trying add together api php files again, operating on assumption had wrong. when added files , ran code got several errors using deprecated operators @ various lines in filemaker api. turns out several lines utilize old =& when creating objects , cause of errors. 1 of errors can remove '&' , ok. 1 of lines (i think around line 72), if right removing '&' api start returning wrong results. went wrong first time around.
the 2 options see drop downwards older version of php =& operator not deprecated or suppress warnings in php.ini. opted latter:
error_reporting = e_all & ~e_deprecated & ~e_strict
php api filemaker
Comments
Post a Comment