[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[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: generate, php, report

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.
[+][-]03/29/03 09:19 PM, ID: 8232930Expert Comment

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/03 10:06 PM, ID: 8233001Expert Comment

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/03 03:03 AM, ID: 8233457Expert Comment

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/03 05:09 PM, ID: 8242402Author Comment

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/03 01:21 AM, ID: 8244314Expert Comment

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/03 01:30 AM, ID: 8244359Expert Comment

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/03 02:36 PM, ID: 8249274Accepted Solution

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/03 01:11 AM, ID: 8252189Expert Comment

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/03 01:12 AM, ID: 8252190Expert Comment

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/03 06:28 AM, ID: 8253698Author Comment

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/03 07:33 AM, ID: 8299974Author Comment

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...
20091111-EE-VQP-89