Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8933397
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:31:41+00:00 2026-06-15T09:31:41+00:00

I am using this plugin http://mods.mybb.com/download/online-today-1.2.2 the below part is query $queries[] = $db->simple_select(

  • 0

I am using this plugin

http://mods.mybb.com/download/online-today-1.2.2

the below part is query

        $queries[] = $db->simple_select(
        "users u LEFT JOIN ".TABLE_PREFIX."sessions s ON (u.uid=s.uid)", 
        "s.sid, s.ip, s.time, s.location, u.uid, u.username, u.invisible, u.usergroup, u.displaygroup",
        "u.lastactive > $timesearch ORDER BY u.username ASC, s.time DESC"
    );
    $queries[] = $db->simple_select(
        "sessions s LEFT JOIN ".TABLE_PREFIX."users u ON (s.uid=u.uid)",
        "s.sid, s.ip, s.uid, s.time, s.location, u.username, u.invisible, u.usergroup, u.displaygroup",
        "s.time>'$timesearch' ORDER BY u.username ASC, s.time DESC"
    );

Now i want to modify this query in order to fetch only users which has greater than 0 post count. So at least 1 post and above

thank you

php, mybb

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T09:31:42+00:00Added an answer on June 15, 2026 at 9:31 am

    Try this code:

        $queries[] = $db->simple_select(
        "users u LEFT JOIN ".TABLE_PREFIX."sessions s ON (u.uid=s.uid)", 
        "s.sid, s.ip, s.time, s.location, u.uid, u.username, u.invisible, u.usergroup, u.displaygroup",
        "u.lastactive > $timesearch AND u.postnum > 0 ORDER BY u.username ASC, s.time DESC"
        );
        $queries[] = $db->simple_select(
        "sessions s LEFT JOIN ".TABLE_PREFIX."users u ON (s.uid=u.uid)",
        "s.sid, s.ip, s.uid, s.time, s.location, u.username, u.invisible, u.usergroup, u.displaygroup",
        "s.time>'$timesearch' AND u.postnum > 0 ORDER BY u.username ASC, s.time DESC"
        );
    

    I just added an additional WHERE clause that checks the postnum field to make sure it’s greater than 0.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using this chat plugin: http://sandbox2.pseudocoder.com/demo/chat In chat.js, I tried using the below
I made an image slider using this plugin http://slidesjs.com/ while ago for a mobile
I'm using this great plugin: http://www.sanisoft.com/blog/2009/06/22/jquery-auto-correct-plugin/ But it's not working with 1.6.2 or greater...
I'm using this JQuery autocomplete plugin http://www.devbridge.com/projects/autocomplete/jquery/ in my project. I followed this tutorial
I'm using this plugin for jquery called resize-crop: http://code.google.com/p/resize-crop/ The problem with this is
I am using this plugin for my new site: http://colorpowered.com/colorbox/ The page in concern
I'm using a tutorial plugin - http://particlebits.com/code/jquery-tutorial/ which has this code attached to the
I am using this plugin ..but this plugin http://jquerymsgbox.ibrahimkalyoncu.com/ is not working in IE7.
I am using this plugin: http://plugins.jquery.com/project/history on this page: http://www.crtaci.info/index.php?autocom=majice I dont know why
I'm using this plugin: http://cssglobe.com/post/5780/easy-slider-17-numeric-navigation-jquery-slider Demo: http://cssglobe.com/lab/easyslider1.7/02.html Maybe somewhere in here can be altered?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.