close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

problem with showing online users

Thread began 1/27/2014 2:35 pm by khon_lao435659 | Last modified 1/29/2014 2:35 pm by khon_lao435659 | 2938 views | 10 replies

khon_lao435659

problem with showing online users

i have a couple of problems. first one is i get this error testing my whoischeck.php

2014-01-22 15:41:42No database selectedNo database selectedNo database selected
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/webim028/public_html/SolaDB/whoischeck.php on line 32

second problem:
there was no session for my user email. so i created $_SESSION['SecurityAssist_UserEmail'];
with security assist i added the update records for both login and logout using the new session i made, but everytime i log in it does not update my table.

code for the whoischeck.php

<?php require_once('Connections/announcement.php'); ?>
<?php require_once('webassist/security_assist/helper_php.php'); ?>
<?php


////// To update session status for user table to get who is online ////////
if(WA_Auth_RulePasses("Logged in to pcms2_users")){ // Begin Show Region
$tm=date("Y-m-d H:i:s");
$xses=$_SESSION['SecurityAssist_UserEmail'];
$q=mysql_query("update pcms2_users set connected_usr='Y', tm_usr='$tm' where UserEmail='$xses'");
echo $tm;
echo mysql_error();}
else{

}

///// ////////////// End of updating login status for who is online ///////

// Find out who is online /////////
$gap=10; // change this to change the time in minutes, This is the time for which active users are collected.
$tm=date ("Y-m-d H:i:s", mktime (date("H"),date("i")-$gap,date("s"),date("m"),date("d"),date("Y")));
//// Let us update the table and set the status to OFF
////for the users who have not interacted with
////pages in last 10 minutes ( set by $gap variable above ) ///

$ut=mysql_query("update pcms2_users set connected_usr='N' where tm_usr < '$tm'");
echo mysql_error();
/// Now let us collect the userEmail from table who are online ////////
$qt=mysql_query("select UserEmail from pcms2_users where tm_usr > '$tm' and connected_usr='Y'");
echo mysql_error();

while($nt=mysql_fetch_array($qt)){
}

?>

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...