[FX.php List] Can we run scripts on filemaker using FX?

Steve Winter steve at bluecrocodile.co.nz
Wed Oct 27 02:56:43 MDT 2004


Hi,

I'm not entirely sure I understand what you're trying to do here, but I'll
have a lash at helping out... :-)

> So guys how do we work on this? i have this but it returns a 
> error response. i have a script TimeStamp, that when access 
> put something on a field.


> // connect
> $query = new FX("192.168.10.11", "8080");
> $query -> SetDBData("TempDBF.fp5", "AllFields");
> 
> //find
> $query -> AddDBParam("-script", "TimeStamp");
> $query -> AddDBParam('RecordNo', 1);
> $data1 = $query->FMFind();
> 
> foreach ($data1['data'] as $key => $value){
> $currentRecord = strtok($key,'.');
> }

So the idea here is to find the record in which the user defined field
RecordNo = 1, and run the script called TimeStamp...then get the recID for
that record...(you do realise that this will always be the same thing don't
you...?  Because the search for RecordNo = 1 is always going to return the
same record...)I presume the important thing here therefore is to run the
script and get the -recID
 
> //edit
> $query -> AddDBParam('-recid', $currentRecord);
> $query -> AddDBParam('Description', "WALA");
> $data2 = $query->FMEdit();

This needs to be a different query, so you need to apply all of the
constructors to it, and give it a new name;

$query2 = new FX("192.168.10.11", "8080");
$query2 -> SetDBData("TempDBF.fp5", "AllFields");
$query2 -> AddDBParam('-recid', $currentRecord);
$query2 -> AddDBParam('Description', "WALA");
$data2 = $query2 ->FMEdit();

Presumably the purpose of query 1 is really to get the -recID so that you
can do the edit in the next query...??...but there seems to be little point
in doing this unless somewhere else you change the value of 'Description' to
some other value as (because you're always going to get the same -recID)
once you've set the value once, well, it's set...perhaps if you could
explain a little more about what you're trying to do I might be able to be
more helpful...

Cheers
Steve

> -- 
> Louie Miranda
> http://www.axishift.com 
> _______________________________________________
> 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