[FX.php List] I need a refresher
Jonathan Schwartz
jschwartz at exit445.com
Thu Dec 8 17:01:03 MST 2011
John,
Two suggestions:
1) check the order of parameters for SetDBUserPass. Doesn't the Pass come first?
2) Reduce the problem query to just an edit request on a single record. Hardcore the recid. At least you will know that you are dealing with a single issue, rather than one involving a query and edit of multiple records on a loop.
Try that and see where you get.
Jonathan Schwartz
Exit 445 Group
415-370-5011
On Dec 8, 2011, at 11:21, John Funk <jfunk at criticalsolution.com> wrote:
> Hi,
> I am a bit rusty at PHP and FX....I have some code below that I need to figure out why I keep getting an error 507 error.
> The script works “getting” the three FileMaker records that match the $Item string.
> I just cannot figure out why it will not edit the record with the $RecID
> Thanks for any help.
> John Funk
>
> <?php
> require_once ('FX/FX.php');
> require_once ('FX/server_data.php');
> define('DEBUG', True);
>
> //Get Item Info from URL
> $Item=$_REQUEST['Item'];
> $Date=$_REQUEST['Date'];
>
> //echo "Item=".$Item.'<br>';
> //echo "Date=".$Date.'<br>';
> //exit;
>
> //GETTING THE ARRAY OF RECORDS WORKS
> $groupSize='10';
> $request = new FX($ServerIP, $Port, $DataSourceType);
> $request->SetDBData($fmdb,'XML_Items',$groupSize);
> $request->SetDBUserPass($fmAccount, $fmPass);
> $request->AddDBParam('ItemNumber_Prism', "=".$Item);
> $result =$request->FMFind();
> $records =$result['data'];
>
> foreach($records as $record)
> {
> $RecID=$record['recid'][0];
> $TCIN=$record['ItemNumber_Prism'][0];
> $ASIN=$record['ASIN_Prism'][0];
> $ImageUploadedDate=$record['ImageUploadedDate'][0];
> $Notes=$record['Notes'][0];
>
> //EDITING THE EACH RECORD DOES NOT WORK
> $request = new FX($ServerIP, $Port, $DataSourceType);
> $request->SetDBData($fmdb,'XML_Items',1);
> $request->SetDBUserPass($fmAccount, $fmPass);
> $request->AddDBParam('-recid', $RecID);
> $request->AddDBParam('Notes', ‘TEST’); //FAILS HERE with 507
> $result = $request->FMEdit();
>
> }
>
> ?>
>
>
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20111208/b2fc7a37/attachment.html
More information about the FX.php_List
mailing list