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 6210073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:05:47+00:00 2026-05-24T06:05:47+00:00

I have 2 areas that I know are process whores but I don’t know

  • 0

I have 2 areas that I know are process whores but I don’t know how to better them.

The 2 places in question are shown here

https://i.stack.imgur.com/JqlA8.png

And the corresponding queries

Area 1

$nresult = mysql_query("SELECT time
                       FROM log
                       ORDER BY time
                       LIMIT 1") or die(mysql_error);

$nr = mysql_fetch_assoc($nresult);

$aresult = mysql_query("SELECT *
                       FROM log") or die(mysql_error);

$an = mysql_num_rows($aresult);

$aresult = mysql_query("SELECT AVG(players)
                       FROM log") or die(mysql_error);

$ap = mysql_fetch_assoc($aresult);

$average = round($an/((time()-$nr['time'])/60/60), 2);

echo "<p class=\"tf2\"><span>{$an}</span> items since " . date("F j, Y", $nr['time']) . " at " . date("g:i a", $nr['time']) . ".<br /><span>" . $average . "</span> items received per hour (<span>" . round($average / $ap['AVG(players)'], 2) . "</span>/player/hour).<br />Showing <span>{$_SESSION['limit']}</span> items per page.</p>";

Area 2

if (!empty($_GET['s']) && !empty($_GET['t']) && !empty($_GET['m'])&& !empty($_GET['q'])) {

    if ($_GET['m'] != 'all') {

        $m = "AND method = {$_GET['m']}";
    }
    else {

        $m = '';
    }

    if ($_GET['q'] != 'all') {

        $q = "AND quality_id = {$_GET['q']}";
    }
    else {

        $q = '';
    }

    if ($_GET['s'] == ' ') {

        $s = '1=1';
    }
    else {

        $s = "{$_GET['t']} LIKE '%" . mysql_real_escape_string($_GET['s']) . "%'";
    }

    $num_result = mysql_query("SELECT *
                              FROM log
                              LEFT JOIN item_definition
                              on log.item = item_definition.item_definition_desc
                              LEFT JOIN method
                              on log.method = method.method_id
                              LEFT JOIN item
                              on item_definition.item_definition_id = item.item_id
                              LEFT JOIN server
                              on log.server = server.ip
                              LEFT JOIN quality
                              on log.quality = quality.quality_id
                              WHERE {$s}
                              {$m}
                              {$q}")
                              or die(mysql_error());
}
else {

    $num_result = mysql_query("SELECT *
                              FROM log") or die (mysql_error());
}

$total = mysql_num_rows($num_result);

echo "<center>" . $total . " results</center><br />";

The live page is here http://www.tf2items.711clan.net/

As you can see, it takes a good amount of time for it to load.

Any tips are appreciated.

  • 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-05-24T06:05:48+00:00Added an answer on May 24, 2026 at 6:05 am

    I don’t see any LIMIT/OFFSET commands.. maybe this gives you a boost if you use paging in your shop.
    Or you could also try to cache it somewhere (if the search filters don’t change)..

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

Sidebar

Related Questions

I have an image, that has transparent areas and a known backround. But wheh
I have inherited a DotNetNuke codebase and have come across areas that have included
I have a HTML/CSS File laid out with a bunch of areas that need
I have a global app that prevents the mouse from moving into areas of
I have a situation where we have a solution that uses Portable Areas and
I have a Drupal setup like this: Content type: Apartments Vocabulary: Areas , that
I know that for parsing I should ideally remove all spaces and linebreaks but
If I have a development area that I deleted files from a certain folder/directory,
I have an application that has an area that is supposed to behave somewhat
I have a container MovieClip that serves as a content area that I need

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.