Mysql
 SQL >> Database >  >> RDS >> Mysql

Correggere controlli online/offline PHP e MySQL

Se il controllo dello stato online fallisce, potresti confrontare stringhe di data invece di timestamp numerici. Converti il valore del database in timestamp UNIX.

SELECT userid, handle,
  UNIX_TIMESTAMP(online) AS online
FROM ^users;

Poi confronta con il tempo corrente, ad esempio $time >= time() - 300.