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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:08:41+00:00 2026-06-04T20:08:41+00:00

In my script, I need to receive information from database (with httpd log file),

  • 0

In my script, I need to receive information from database (with httpd log file), by everyday traffic consumption.

So, if was 30 day in month I do it with following code, 30 times in cycle:

$sql = "SELECT round(sum(bytes)/1048576) FROM logdata WHERE time_stamp BETWEEN '2012-" .$aMonth . "-" . $aDay ." 00:00:00' AND '2012-" .$aMonth . "-" . $aDay ." 23:59:59' AND status=200";

It works rather slow.

I think, it possible to receive all results for all days in one resultset, with stored proc, or query.

Can anybody help me?
Thanks.

  • 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-04T20:08:42+00:00Added an answer on June 4, 2026 at 8:08 pm
    SELECT day,ROUND(total/1048576)
    FROM (
        SELECT DATE(time_stamp) day,sum(bytes) total
        FROM logdata
        WHERE status=200
        GROUP BY 1
    ) t;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In shell script i need to redirect output from dd command to /dev/null -
I need a script to convert a comma seperated csv file to an excel
I need a script that inserts a number at some point into a file
I am working on an Asset Database problem. I receive $id from $_GET[id]; I
for one of my applications, I am trying to send/receive commands/information from my GUI
I use following code to receive a connection: socat TCP-LISTEN:4000,fork EXEC:./myscrpit I need to
I need to write a script in Matlab, which will read some data from
What's the easiest way to execute a Python script from Java, and receive the
I have JSP with javascript in the title of it. Script need to be
I have a php script I need to run every 5 seconds (run, wait

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.