Jump to content

Logged in users


vividona

Recommended Posts

I need to select users who logged in during 24 hours

$time = time() - (60*60*24);

	$chkusers = $SiteDatabase->dbqueries("SELECT `uid`, `username`, `lastaccess` FROM
	" . ArticleSystem::BHL_DB_PREFIX . "" . ArticleSystem::BHL_DB_USER_TBL . " WHERE `lastaccess` < '$time' ORDER BY `lastaccess` DESC");

 

my code count wrong time.

 

Link to comment
https://forums.phpfreaks.com/topic/194478-logged-in-users/
Share on other sites

I resolved it like this

$time = time();
	$time2 = time() - (60*60*24);

	$CheckArtisList = $SiteDatabase->dbqueries("SELECT `uid`, `username`, `lastaccess` FROM
	" . ArticleSystem::BHL_DB_PREFIX . "" . ArticleSystem::BHL_DB_USER_TBL . " WHERE `lastaccess` > '$time2' AND `lastaccess` < '$time' ORDER BY `lastaccess` DESC");

 

thank you guys

Link to comment
https://forums.phpfreaks.com/topic/194478-logged-in-users/#findComment-1022940
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.