please guys i am making an app and i want to show the number of users online on the app i have this code

function whoisonline()
    {
        //what are my variables values
        $email=$_SESSION['jwp_email'];
        $sqloo="SELECT `id` FROM users WHERE email='$email'";
        #mysql_query($sqloo)
        if ($run=mysql_query($sqloo)) {
            $b=mysql_fetch_assoc($run);
            $b['id'];
            $c=$b['id'];
        }

        $ip=$_SERVER['REMOTE_ADDR'];    
        $ip_ua=$_SERVER['HTTP_USER_AGENT'];
        $time=time();
        $usr_id=$c;

        //(`id`, `usr_id`, `usr_ip_address`, `usr_logged_out`)

        $sqlpp="SELECT * FROM usr_online WHERE usr_id = $usr_id";
        if ($running=mysql_query($sqlpp)) {

        };

            if (mysql_num_rows($running) == 0) {
                $sql="INSERT INTO `usr_online` VALUES ('','$usr_id','$ip','$time','0')";
        mysql_query($sql);

            }
            else
            {
                if (mysql_num_rows($running) >= 1) 
                {

                $sql="UPDATE `usr_online` SET `time`='$time',`usr_ip_address`='$ip',`usr_id`='$usr_id',`usr_logged_out`='0' WHERE  usr_id = '$usr_id'";
                mysql_query($sql);

                }
            }

        $sss="SELECT * FROM usr_online";
        $gg=mysql_query($sss);
        $d=mysql_fetch_assoc($gg);
        //print_r($d);





    }

please i want to show all the users online but the problem is that when i do a select all usr_id in the atabase it just return only one row of data please what can i do...

1 Add Link to Your Email Signature. Seems obvious, but most people don’t do this. You should have your value proposition at the bottom of your email with a link to your splash page.
2 Add Link to All Your Web Profiles. Add a link to your splash page on your Facebook, Linkedin, Twitter and every other account you have. Now you might see why it helps to be a high profile social media user.
3 Create a Demo Video. Even if your prototype isn’t ready, create a demo video of what your prototype will be doing. Dropbox did this and their video appeared at the top of Digg giving them 100,000 email addresses wanting access to their site. You can also add this video to your splash page to help increase conversion of people submitting their email addresses
4 Be Full Entrepreneur. When I went to tech events, friend’s drinks, family gatherings, I would pitch everyone on Yipit. Painful, yes. But, it got me good at pitching Yipit and those people would go home and sign-up to check it out.
5 TechCrunch and other tech blogs. It will be hard to get press for your site if you can’t give the blogger a prototype to use. But, if you do have a working prototype, this the easiest way to get people to your splash page. For all three of our projects, 140it.com, UnHub.com and Yipit.com, we were able to get TechCrunch to write about us just by submitting it to through their news submission form. If you can give the bloggers some beta codes for their readers, that makes it more likely they’ll write about your site. Just make sure you’re ready for it. If you have a very good demo video, they might be willing to write about you without the prototype.
6 HackerNews. HackerNews is a great community of entrepreneurs who are willing to give you good advice on your startup. You need to have a working prototype and let them look at the site directly, though. Here’s some great advice on how to submit to HackerNews.
7 Facebook Ads and Google Adwords. This is actually really hard and often pretty expensive. We were never able to really pull this off despite several attempts.
8 Start a company blog. The blog should be focused on providing helpful advice on the problem you are helping consumers solve. Kissmetrics, a startup focused on helping websites with analytics, runs an excellent blog on helping startups think through user acquisition. This strategy involves a lot of work so only do ito create and think that users will appreciate it.
for more vist training.cqlsys

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.