Hello all,
I would like to know if there is any method when using MySQL to INSERT a row containing the UNIX timestamp from the DB server machine in a single query ?
Currently, I have 9 webservers running, so when I do an INSERT like this:
$time = time();
INSERT INTO table SET time='$time'.....";
Sometimes the order they get inserted in is not actually the correct order they should be (ie. the webservers' dates get out of synch sometimes...even if its by 10 seconds or so).
This causes problems for me, as the above is in a PHP/MySQL chat program I coded. Thus a user on one webserver might say something after another, but it will appear before in the display.
I suppose everytime I insert, I can go fetch the time of another machine, but this adds much overhead. Is there anyway in MySQL to use the time of the DB machine ??
Thx