online status?
hello,
instead to calculated how many users are online , away , busy
and show it?
anyone a idea how to do it?
thanks
Code: Select all
it count all users that are in the list$q = mysql_query("SELECT COUNT(*) FROM `users` WHERE ((`username`='$friend_id' AND `onlinestatus`='online') OR (`username`='$friend_id' AND `onlinestatus`='away'))");
$n = mysql_num_rows($q); //COUNTS USERS ONLINE
echo $n;
instead to calculated how many users are online , away , busy
and show it?
anyone a idea how to do it?
thanks
visit us on:
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
Code: Select all
//Connection stuff
$total = 0;
$con = mysql_connect(DB_SERVER, DB_USER, DB_PASS);
if (!$con)
{
die('Error while trying to connect to db: ' . mysql_error());
}
mysql_select_db(DB_NAME, $con);
$result = mysql_query("SELECT `onlinestatus` FROM `users` WHERE `username`='$friend_id'") or die(mysql_error());
$row = mysql_fetch_assoc($result);
foreach($row as $content) {
if ($content=='online') {
$total++;
}
else if ($content=='away') {
$total++;
}
}
echo $total;
Last edited by Filip on Thu Feb 28, 2013 5:38 pm, edited 4 times in total.
CodenStuff wrote:Nope, it's just your sick and dirty mind. You sick twisted warped little pervo
hello filip,
thanks for reply.
but does not count?
lets say you have 10 friends
2 are offline
3 away
3 online
2 busy
so it will show : 8
you understand what i mean
thanks for reply.
but does not count?
lets say you have 10 friends
2 are offline
3 away
3 online
2 busy
so it will show : 8
you understand what i mean
visit us on:
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
Oh sorry,
I misunderstood the question
I edited the code on first reply
I misunderstood the question
I edited the code on first reply
CodenStuff wrote:Nope, it's just your sick and dirty mind. You sick twisted warped little pervo
hello #Filip
thanks again
but :( not working
thanks again
but :( not working
visit us on:
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
What is the error that you are getting?
CodenStuff wrote:Nope, it's just your sick and dirty mind. You sick twisted warped little pervo
no error just nothing to display :(
visit us on:
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
There was a typo, try again.
Did you fill in the sql connection fields?
Did you fill in the sql connection fields?
CodenStuff wrote:Nope, it's just your sick and dirty mind. You sick twisted warped little pervo
seems its not calculating it only show 1
visit us on:
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
Try running
Code: Select all
in phpMyAdmin and see the resultsSELECT `onlinestatus` FROM `users` WHERE `username`='put something here'
CodenStuff wrote:Nope, it's just your sick and dirty mind. You sick twisted warped little pervo
Copyright Information
Copyright © Codenstuff.com 2020 - 2023