db()->sql - execute now

db()->sql - execute now

FreedyFreedy Posts: 33Questions: 5Answers: 0

Hi,

Is there a way to make db()->sql commands execute now? Instead on waiting on ->process?

Replies

  • allanallan Posts: 63,075Questions: 1Answers: 10,384 Site admin

    If you are calling $db->sql() yourself it will execute immediately.

    Can you show me your script please?

    Allan

  • FreedyFreedy Posts: 33Questions: 5Answers: 0

    ->on( 'preEdit', function ( $e, $id, $values ) { $result = $e->db()->sql("INSERT INTO orders (OrderID, TotalUnits, Date) VALUES ('".$newWO."', .$numUnits."', ".$curDate."')"); some other code which depends on the above being executed. }

  • FreedyFreedy Posts: 33Questions: 5Answers: 0

    after some digging I found it get executed by
    if ( $this->_transaction ) { $this->_db->commit();

  • allanallan Posts: 63,075Questions: 1Answers: 10,384 Site admin

    Thanks for posting back - good to hear you got it working.

    Allan

This discussion has been closed.