Mysql Transaction Help

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Mysql Transaction Help

    mysql_query('SET AUTOCOMMIT = 0; START COPYING');
    mysql_query($query1);
    mysql_query($query2);
    ......
    mysql_query($query7);
    if ( $all done )
    mysql_query( 'COMMIT' );
    else mysql_query( 'ROLLBACK' );

    now here is a problem whenever in transaction process amount of mysql query's exceeds 2 query's , the script will start looping (don't know what kinda looping, just an guess don't laugh now ) without any sign of terminating until the script process reaches php max execution time limit...
    well that's minor now comes the real headache after that any mysql query run will do same behaviour, will start looping until php max execution time limit is reached .

    strange ..........
    well this is working fine with mysqli & odbc DB's .
    Last edited by StunningNick; 11.03.12, 12:47. Reason: wording correction

    #2
    Originally posted by StunningNick View Post
    mysql_query('SET AUTOCOMMIT = 0; START COPYING');
    mysql_query($query1);
    mysql_query($query2);
    ......
    mysql_query($query7);
    if ( $all done )
    mysql_query( 'COMMIT' );
    else mysql_query( 'ROLLBACK' );

    now here is a problem whenever in transaction process amount of mysql query's exceeds 2 query's , the script will start looping (don't know what kinda looping, just an guess don't laugh now ) without any sign of terminating until the script process reaches php max execution time limit...
    well that's minor now comes the real headache after that any mysql query run will do same behaviour, will start looping until php max execution time limit is reached .

    strange ..........
    well this is working fine with mysqli & odbc DB's .

    Please post full code / mysql request with defined $vars ... so we can help you !

    $query1 ??? $query2 ??? $query7 ??? $all done .. i know you've just posted the executing idea .. form .. but you will not get any help this way !
    This is ten percent luck, twenty percent skill
    Fifteen percent concentrated power of will
    Five percent pleasure, fifty percent pain

    And a hundred percent reason to remember the name!

    Comment


      #3
      @just_m3

      well it does not matter what query i make
      it maybe any simple CRUD statement, results are same, i tried making it separate from main project and run through it's own individual page , i haven't found any solution else of restarting system even same occurred on local machine.... ( tried mysql_close() thought it may close connection & will not have to restart entire system )

      Comment


        #4
        mysql_query( 'SET AUTOCOMMIT = 1' ); finally solved it ... :D

        Comment

        Working...
        X