I am relatively recent to web programming. I really hope that one is simple. I have got a server application running that's monitoring a SQL table. Whenever an integer area turns positive, the application reads the relaxation from the row and fills inside a lengthy text area within the same record. I have now got a php script that sets the int area, and requires to hang about until the application sets the area to zero after which browse the text area and echo it to the remote user. I attempted this (odbc):

$processed = 0;
while ( !$processed )
    $rs = odbc_exec( $conn, $sql );
    $processed = odbc_result( $rs, "Processed");
    $output = odbc_result( $rs,"OutputSpec");

I takes about 5 sec. to complete. Not fast enough. I put a counter in also it takes ~10000 iterations for 'processed' to alter. I understand my server application changes the area immediately. Similar increase the risk for SqlServer. There has to be something stalling the commit or something like that?

you should utilize the observer pattern

make use of a known action to trigger an update.

Here are a few PHP implementation details