a new day and a new problem..
i tried my best to write a trigger to update a related record
like in the facultyOfWidgetry example i have a table called catalogue and a table workflow
the relationship is stored in a table programcourses
my relationships.ini in catalogue folder looks like this:
//----------------------------------------------snip-------------------
[workflow]
__sql__ = "SELECT * FROM programcourses pc INNER JOIN workflow c ON pc.local_ID = c.local_ID WHERE pc.artikel_ID = '$artikel_ID'"
//----------------------------------------------snap---------------------
my plan was to update the table catalogue when i save a record in the workflow table
unfortunately my sql knowledge is quite poor
hopefully somebody of you can help?
strval('completed') != 0){
//-----------------------outline----------------------------------------------------------------------
// $record->strval('completed')is a date time field
how to sql now?... i neither know the correct sytax nor do i know how to figure out the related "artikel_ID"
// $sql = 'UPDATE catalogue'
// . ' SET $record->strval('lang_ID') = '$record->strval('completed')''
// . ' WHERE artikel_ID = "is like the related artikel_id(don«t know how to get it)"';
//------------------------------------------------------------------------------------------------------
$response['--msg'] .= "\nchanged status in catalogue to: ".$record->strval('completed');
} else {
return PEAR::raiseError(
"Errors occurred while saving Record. Record could not be inserted",
DATAFACE_E_NOTICE);
}
}
}
?>
cheers
martin