SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict Ghz's Avatar
    Join Date
    Jun 2002
    Posts
    284
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    too many queries I think

    Hello friends,
    I'm planning to make an online/offline users and members surfing my forums in a moment, just like any other forums. Now, what I want to do exactly is to count the whole poeple surfing the forum wether they were registered or guests, and members alone and guests alone. I thought of making three queries. The first counts the whole number, the second counts the members, and the third counts the guests. It's working fine but taking into consideration that I have more than 20 queries in the index page that will add three more queries to the 20 to be 23 which are too many I guess. My question is:

    Is it to much to have that number of queries in a page? and is there any other way to reduce this number of queries by using other techniques???

    Any help would be appreciated in advance

  2. #2
    SitePoint Member
    Join Date
    Feb 2002
    Location
    North Carolina
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    23 is definitely high. You really won't need any more than two queries at most to show who's online. Possibly one for the members, and one for the guests. But then you can just add these two numbers together in PHP to get the total.
    Deluxe Portal Project Manager

  3. #3
    SitePoint Addict Ghz's Avatar
    Join Date
    Jun 2002
    Posts
    284
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You are right Andrew275. Now we got rid of one query, what shall I do with the rest??? Don't you think 20 queries for one page is too much??? Usually they are less than 12 in IPB, how do they do that???

  4. #4
    SitePoint Member
    Join Date
    Feb 2002
    Location
    North Carolina
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Couldn't say, without seeing a list of the queries you're doing.
    Deluxe Portal Project Manager


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •