V
V
Vlad Nesterenko2017-07-21 10:43:40
PHP
Vlad Nesterenko, 2017-07-21 10:43:40

Event in firebird and how to handle them in php?

Good afternoon, I can’t figure out the events in firebird in any way. I created a trigger in the database that sends an event, the ibase_wait_event function works, but the call to the handler function (ibase_set_event_handler) does not, Tell me what's the problem? Here is the code:
body>
<?php
$vx=$_POST[vx];
if ($vx=="Login"){
$host = 'localhost:C:\ProgramData\Medoc\Medoc\db\ZVIT.FDB';
$dbh = ibase_connect($host, 'SYSDBA', 'masterkey');
ibase_wait_event("MMS");
function event_handler($event_name, $dbh)
{
ibase_query($dbh, "UPDATE FJ1201002_TAB1 SET TAB1_A13='rrr' WHERE CODE='5718'");
}
$b=ibase_set_event_handler($dbh, "event_handler", "MMS");
echo($b);
}
?>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
atomos90, 2018-02-22
@atomos90

Maybe I'm wrong, but, in my opinion, ibase_wait_event() slows down the script before the event occurs, ibase_set_event_handler() does not wait, but continues to work and the script has time to complete before the event fires. Maybe it makes sense to run an infinite loop after ibase_set_event_handler(), the exit condition from which will be the triggering of event

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question