MX Kollection Forum :: How to break transaction?

This thread was displayed: 0 times

Starting with 17th May 2007, Adobe Systems will stop offering support for any version of the discontinued InterAKT products. As a result, we will not answer to new support incidents starting with May 17th, 2007. Pending support incidents will still be followed in order to be closed. The product forums will remain open and be transformed in user-to-user forums. The general forums will be made read-only and not allow new posts or comments.

For more information about the affected products visit: www.interaktonline.com/Support/


View All View Non Threaded Newest first
  • 03-09-2009 11:30:58 GMT +2 David Wu

    If we manage some check trigger before insert or update transaction such as check old password, it will do some check and decide to do the insert or not by the result of check, it's like

    1. check password
        1. correct
            executer insert transaction
        2. wrong
            skip insert transaction
            diaplay transaction error



    tha's mean if we check something wrong, it's skip the insert and show the error message, I want to know how to stop the transaction if I do some check by myself

    1. check something
        1. right
            execute insert transaction
        2. wrong
            skip insert transaction
            diaplay transaction error

    • 03-09-2009 11:44:09 GMT +2 Fred at ExelWebs.com

      Hi David,

      When you build your form decide what fields to validate / check.

      It will then stop the transaction from happening.

      You can add the "Validate Form" SB to achive this is you did not do it when you created the form in the first place.

      If you are looking to do it manually I just found this tutorial

      I did not really look at it but it will most certainly give you a basis to work from.

      • 03-09-2009 12:03:52 GMT +2 David Wu
        I am sorry, I didn't see anyt... View more

         I am sorry, I didn't see anything to do with transaction engine in the website you offer?

        • 03-09-2009 12:34:49 GMT +2 Fred at ExelWebs.com
          If you do not want to use the ... View more

          If you do not want to use the interakt validation script you will need to code the solution yourself.

          That is the reason I sent you the link to the php tutorial.

          • 03-09-2009 13:00:19 GMT +2 David Wu
            I want to code by myself that'... View more

            I want to code by myself that's right, and I also want to follow the transaction engine, that's why I make a trigger to do the check before insert transaction, I put the check in that trigger before insert transaction, but I don't know how to pass the insert transaction and doing something else if I want to, for example

            //start checkPmIns trigger
            function checkPmIns(&$tNG) {
                /*check duplicate*/
                include('../../Connections/conndb.php');
                include('../../backsite/functions_backsite.php');
                mysql_select_db($database_conndb, $conndb);
                $query = sprintf("SELECT * FROM bag_product_manage WHERE p_id = %s AND pm_type = %s",
                    toSql($_GET['pid'], 'int'),
                    toSql($_GET['type'], 'int'));
                $Rec = mysql_query($query) or die(mysql_error());
                $num = mysql_num_rows($Rec);
                mysql_free_result($Rec);
                if ($num > 0) {
                    echo '<div id="res">this product is already in database</div>';
                    exit;
                }
            }

            Now I use exit, but it's not the bese way.

            • 03-09-2009 13:34:54 GMT +2 Fred at ExelWebs.com
              I see you want to check if a p... View more

              I see you want to check if a product is already in the DB.

              Why don't you just use the "Check Unique Key" SB and take it from there?

              • 03-09-2009 13:35:50 GMT +2 David Wu
                because I have two condition, ... View more

                because I have two condition, and I really want to know how to do it.

                • 03-09-2009 14:29:02 GMT +2 Fred at ExelWebs.com
                  Not exactly sure what you are ... View more

                  Not exactly sure what you are trying to achieve.

                  If you simply want to do something else if the expression is "true" then you can do something like this or look at the php manual on controll structures here.

                  if ($num > 0) {
                          echo '<div id="res">this product is already in database</div>';

                      // Redirect the user to the wherever1.php page.
                  // Start defining the URL.
                  $url = 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']);

                  // Check for a trailing slash.
                  if ((substr($url, -1) == '/') OR (substr($url, -1) == '\\') ) {
                  $url = substr ($url, 0, -1); // Chop off the slash.
                  }

                  // Add the page.
                  $url .= '/wherever1.php';

                  header("Location: $url");
                  exit();    }
© Adobe Systems Romania. All rights reserved.