[FX.php List] Noob needs help with edit record

Andrew Denman adenman at tmea.org
Wed Jan 2 17:35:51 MST 2008


Larry,

The Record ID FX.php needs to edit (and delete) a record is the internal
FileMaker one.  If your RecordID field is a calculation that returns the
internal FileMaker Record ID, then all you have to do is fix your 5th line:

$edit_result_edit->AddDBParam('-recid', '5475');

If RecordID is your own ID field, let me know and I'll provide alternate
instructions.

Andrew Denman


-----Original Message-----
From: fx.php_list-bounces at mail.iviking.org
[mailto:fx.php_list-bounces at mail.iviking.org] On Behalf Of Larry Schultz
Sent: Sunday, December 30, 2007 1:06 PM
To: FX.php Discussion List
Subject: [FX.php List] Noob needs help with edit record 

Hi folks, I've gotten to a point where I'm reaching out for help  
after spending 2 days and nights trying to understand how to do an  
edit. All thoughts, suggestions, and help is appreciated.


I've got a scripted email in FM that sends a dynamic link in the  
email. The link is formed like this:

http://71.159.221.216/localtest/PeritusMonSite/trans_eval.php? 
var1=5475&var2=1169&var3=44444&Var4=1778&var5=Larry


var1 is the important variable here, as it is the record ID for the  
record in need of editing.  This record ID field is "RecordID" in the  
db.

I have no problem writing the code to add a record with fx.php, but  
writing the code for an edit is not working for me. I have no idea  
where to look to fix this, hence this post.

Here's the code, minus the html for the results page. It has a static  
value for the record I'd like to edit, until I can make this work.

<?php require_once('../Connections/PeritusFX.php'); ?>
<?php
$edit_result_edit = clone($PeritusFX);
$edit_result_edit->layout = 'TranslatorEvaluationForWeb';
$edit_result_edit->AddDBParam('RecordID', '5475');
$edit_result_fields = array(

'Comments_Accuracy'=>$_POST['Comments_Accuracy'],
'Comments_Completeness[]'=>$_POST['Comments_Completeness'],
'Comments_Spelling'=>$_POST['Comments_Spelling'],
'Comments_Grammer'=>$_POST['Comments_Grammer'],
'Comments_Punctuation'=>$_POST['Comments_Punctuation'],
'Comments_Hyphenation'=>$_POST['Comments_Hyphenation'],
'Comments_Terminology'=>$_POST['Comments_Terminology'],
'Comments_Style'=>$_POST['Comments_Style'],
'Comments_DNLF'=>$_POST['Comments_DNLF'],
'Comments_TCnPD'=>$_POST['Comments_TCnPD'],
'Comments_TypeStyle'=>$_POST['Comments_TypeStyle'],
'Comments_PosIllistrattions'=>$_POST['Comments_PosIllistrattions'],
'Comments_GraphicsErrors'=>$_POST['Comments_GraphicsErrors'],
'Comments_Formatting'=>$_POST['Comments_Formatting'],
'Comments_OnTime'=>$_POST['Comments_OnTime'],
'Comments_WithinBudget'=>$_POST['Comments_WithinBudget'],
'Comments_Responsiveness'=>$_POST['Comments_Responsiveness'],
'Comments_OpenFeedback'=>$_POST['Comments_OpenFeedback'],
'Comments_Communicate'=>$_POST['Comments_Communicate'],
'Comments_OverallNature'=>$_POST['Comments_OverallNature'],

;
foreach($edit_result_fields as $key=>$value) {
     $edit_result_edit->AddDBParam($key,$value);
}

$edit_result_result = $edit_result_edit->FMEdit();

if(is_a($edit_result_result,"FX_Error") || $edit_result_result 
['errorCode'] != "0") fmsTrapError($edit_result_result,"error.php");

$edit_result_row = current($edit_result_result['data']);
$edit_result_row_key = key($edit_result_result['data']);
// FMStudioFX v1.0 - do not remove comment, needed for DreamWeaver  
support ?>
_______________________________________________
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