javascript - How to update a column of a DB table when closing the browser in PHP?

one text

Solution:

I think you try to do get user online time. in that case this not good idea but i think it's work. you can time to time request send on browser using java script (AJEX) and in server side you can update is online time on db. if browser send request time gap greater than with last update time it mean user go off line.

previously i have similar problem and i solve it like this idea.

Source