![]() |
![]() |
||||||
|
|||||||
| Tags: connection, custom, trigger |
![]() |
|
|||
|
Jan,
You would do something like this in the custom trigger: $query = "UPDATE this_table SET this_field = '1'"; $update_result = $tNG>connection>execute($query); if(!$update_result) { $updateError = new tNG_error("Error Updating",array(),array()); return $updateError; } else { return NULL; } This is a basic example that spits out an error if the update is unsuccessful. Look at Chapter 16 of the Adobe Dreamweaver Developer Toolbox Help pdf for more information regarding custom triggers. It gives some more examples. Shane |
|
|||
|
Hello Shane.
I have a insert transaction using Connection_1 and a Custom trigger like your example. But I want to update a second Table of a second Databsase using Connection_2. Your example is using Connection_1. (The same connection as the Transaction) Is it possible to use Connection_2 for the custom trigger? Jan |
|
|||
|
Jan,
I'm pretty sure you can do this. You should be able to do something like this in the trigger: mysql_select_db($database_Connection_2, $Connection_2); $query_RecordsetUpdate = "UPDATE...."; $RecordsetUpdate = mysql_query($query_RecordsetUpdate, $Connection_2) or die(mysql_error()); $row_RecordsetUpdate = mysql_fetch_assoc($RecordsetUpdate); $database_Connection_2 and $Connection_2 need to match the variable names located in your database connection file for Connection_2 located in the Connections folder of your site. I have never had to connect to a separate database, but this should work. Shane |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
- Contact Us
-|-
Adobe Dreamweaver Forums -|-
Archive -|-
Top -|-Rules/Disclaimer-|-Help/Support-|-Advertise