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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:17:54+00:00 2026-05-28T06:17:54+00:00

I have a simple page view tracker that uses a combination of PHP and

  • 0

I have a simple page view tracker that uses a combination of PHP and MySQL to keep a running tally of the number of times the page has been refreshed. There is no complex cookies I just needed to know the raw number refreshes that occur.

It looks like this…

$link = mysql_connect('**********', '*********', '***********');
if (!$link)
{
    die('Could not connect: ' . mysql_error());
}
mysql_select_db("**********", $link);

$query = mysql_query("select value from settings where title like 'search_number'");
$result = mysql_fetch_array($query);
$search_number = $result["value"];
$new_search_number = $search_number + 1;
mysql_query("update settings set value='$new_search_number' where title like 'search_number'");

This code appears to work in all the tests I was capable of running but on the live site it returns ridiculously high numbers. We average 400-500 queries a day according to yahoo, “we use search boss”, but the page tracker reports 8900+ queries a day. Google analytic confirms yahoo’s number. I don’t see how this code could fail due to its simplicity. I was hoping somebody could shed some light on what is going on.

  • 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-28T06:17:55+00:00Added an answer on May 28, 2026 at 6:17 am

    Bots will hit your page more often than you might think. You can compare to your server logs, and I suspect you will see that many requests for your page.

    Also, Google Analytics works client-side, requires JavaScript, and does not always run. This has been predicted to account for as many as 10% or so page views. The bulk of the difference though is that Google Analytics filters out a lot of random hits from bots, as hardly any bots even run the analytics code.

    On another note, the way you are doing your queries is a bit precarious. I recommend learning how to do prepared queries with PDO, to avoid SQL injection attacks.

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

Sidebar

Related Questions

I have a simple form on a view page, implemented as a user control,
I am simply learing Ajax with jQuery and have a simple page method that
I have a simple web page that till now didn't need any login. It
I have a simple cart page that displays items that are in someones cart,
I have made a simple page for a sound board that I made. I
I have a relatively simple example of an MVC page that is using jQuery
With ASP.NET MVC3 (Razor) I have a simple page that loads a jQuery UI
I have a very simple page that simply prompts the user for a name
I have a very simple page that is displaying canned data. I experienced this
I have a simple asp.net web page that contain a table with about 5

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.