Advertisement

03.27.2003 at 10:20PM PST, ID: 20566049
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.4

PHP and Database To Generate Report

Asked by tewald in PHP and Databases

Tags: , ,

I am trying to generate a report that accepts two text entries (start_date and end_date) via a php page and uses these values to query a postgresql database.  My primary objective of this question is to find the most appropriate/accurate way to handle the date range identification and processing so providing thoughts/examples of the necessary loops and arrays is desired. Use any combination of PHP and SQL.

Database table/fields necessary are:

table: tbleventlog
field: id
field: dtdatetime
field: iusername

The input/output (note: users can input any valid start and end dates - no pulldowns, calendars, etc):

Each column of output must represent one week (sunday through saturday mandatory).The trick is to
capture the end_date the user submitted and if it isn't a saturday, find the next calendar saturday and then begin working backward "week-by-week" until we get to the start_date*.  However, the start_date must be a sunday, so if the start_date the user input isn't a sunday, then we need to find the sunday immediately preceeding the start_date supplied by the user.  This functionality must be capable of spanning months and years.

For example: a user submits start-date of 02/18/03 and end_date: 03/07/03.
** 02/18/03 is a tuesday and 03/07/03 is a friday **.  Therefore, the end_date must be redefined as
03/08/03 because that's the next saturday.  Likewise, the start_date  of 02/18/03 will have to be
redefined as 02/16/02 because that's the preceeding saturday.

The report output should resmble the following:

                                       Weekly Logins                
|username                | 02/16/ - 02/22 | 02/23 - 03/01 | 03/02 - 03/08 | total  
|---------------------------------------------------------------------------------------------------|
|johndoe@123.com | 12                    |  0                     |  3                    | 15         |
|janewho@987.com |  3                    |  4                     | 13                    | 20         |
|danwhat@345.com |  1                    | 12                    |  9                    | 22         |
|jimwhen@abc.com |  0                    |  7                     | 15                    | 22         |
|---------------------------------------------------------------------------------------------------|
Thanks and good luck. (Many points for the headache).  Ask for additional details if I haven't been thorough enough.Start Free Trial
[+][-]03.29.2003 at 09:19PM PST, ID: 8232930

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.29.2003 at 10:06PM PST, ID: 8233001

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.30.2003 at 03:03AM PST, ID: 8233457

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.31.2003 at 05:09PM PST, ID: 8242402

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.01.2003 at 01:21AM PST, ID: 8244314

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.01.2003 at 01:30AM PST, ID: 8244359

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.01.2003 at 02:36PM PST, ID: 8249274

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: PHP and Databases
Tags: generate, php, report
Sign Up Now!
Solution Provided By: psadac
Participating Experts: 4
Solution Grade: A
 
 
[+][-]04.02.2003 at 01:11AM PST, ID: 8252189

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.02.2003 at 01:12AM PST, ID: 8252190

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.02.2003 at 06:28AM PST, ID: 8253698

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.09.2003 at 07:33AM PDT, ID: 8299974

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-44