Is there are any ways to stop javascript query on mysql table and wait until next row is inserted?
For example using function:
var query = connection.query('SELECT * FROM table');
I want to read all rows in table, display them and wait until next row is inserted, read inserted row and wait until other is inserted and so on…
Basically it should read table which is updated every time other table gets update from PHP or other script (trigger events).
I can not find any information about cursor sliding in javascript mysql query maybe there are some articles about it?
You could poll for the answer like so, api made up as I’ve never used the mysql library for node.
Row Count Interval
var connection = …,
lastCount;
Better if you have a primary auto-inc key Interval
Another option would be to open a socket, (net, http, etc), on node.js and ping it from the php script to trigger an update.
Hope that helps