[FX.php List] Results of FMNew()

andy at fmpug.com andy at fmpug.com
Sat Dec 10 12:00:33 MST 2005


Chuck -

Try adding a foreach statement after your FMNew to get the data out of the array

foreach ($newResult['data'] as $key => $value)
$newID = $value['LoginID'][0];

<p>ID: <?php echo $newID; ?></p>

Hope this helps

Andy Gaunt
andy at fmpug.com
http://www.fmpug.com

>
>Here is a code snippet from a page that creates a new record:
>
>   $newRecord = NewFX('WebLogins');
>   $newRecord->AddDBParam('EmailAddress', $EmailAddress);
>   $newRecord->AddDBParam('Password', $Password);
>   $newResult = $newRecord->FMNew();
>   $newEmailAddress = $newResult['EmailAddress'][0];
>   $newPassword = $newResult['Password'][0];
>   $newID = $newResult['LoginID'][0];
>
>When this page loads, FileMaker does contain the new record.  
>Shouldn't $newResult contain the data for that record? LoginID is the  
>auto-enter serial number key field for the table, and I want to  
>capture this for later use. But I have a line later in my file:
>
>     <p>ID: <?php echo $newID; ?></p>
>
>No information is shown after the "ID:". It's simply blank. What am I  
>doing wrong?
>
>Thanks,
>Chuck
>
>
>_______________________________________________
>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