Correct my code (3x MYSQL queries) to display results correctly

Completed Posted Oct 1, 2015 Paid on delivery
Completed Paid on delivery

I am having trouble querying MYSQL and displaying the results that I need for a project. I require someone with good MYSQL/PHP skills to correct my code so that it works how I want.

Basically I have a table that contains a field 'order_total' and a field called 'time' which contains a UNIX Timestamp.

Query 1 is: I want to be able to display the sum of 'order_total' for each day for the previous 'x' number of days.

Query 2 is: I want to be able to display the sum of 'order_total' for each week for the previous 'x' number of weeks.

Query 3 is: I want to be able to display the sum of 'order_total' for each month for the previous 'x' number of months.

My current code is not working as expected so I need someone to modify/re-write it so it provides accurate results.

Code and more details are in attached file.

Please only offer services if you can get this working exactly how I want, thank you.

MySQL PHP

Project ID: #8593219

About the project

18 proposals Remote project Active Oct 2, 2015

Awarded to:

santopoulose

Hi, Sir/Madam have a good day! I Have read your description. It would be better if we can have a chat and i can provide you solutions. I can deliver this work well done and as fast as possible. looking forward to More

$15 USD in 1 day
(102 Reviews)
5.7

18 freelancers are bidding on average $22 for this job

cijagani

A proposal has not yet been provided

$25 USD in 1 day
(105 Reviews)
6.3
qualifydeveloper

will do it no problem i am here to start the work right now no problem will do it no problem i am here to start the work right now no problem

$25 USD in 1 day
(56 Reviews)
5.4
kienngd

Dear sir, please contact me. We will discuss about your requirements. When I understand your requirements, I'll fix them for you.

$30 USD in 1 day
(20 Reviews)
4.6
strikovcobalt

Hi I've reviewed notes and the code. Your query doesn't work, because of several problems. First: you use aggregate function SUM without group by clause. Second: order_total is a varchar, not a float column. I think More

$20 USD in 0 days
(19 Reviews)
4.5
emransl

Codes are ready for you to check whether it is working as you expected...............................

$20 USD in 1 day
(20 Reviews)
3.9
Syrusbrian

A proposal has not yet been provided

$15 USD in 3 days
(2 Reviews)
0.4
kaosar77

Hello, Can you give me the sample database? I can do it free for you within 2 days. Although I bid, but I can do it free for you. Hope I will talk with you soon. Thanks, kaosarul

$15 USD in 1 day
(0 Reviews)
0.0
albertjapardi

I had experience with mySQL/Php programming. Looking forward to getting this as my first project for my portfolio here.

$15 USD in 3 days
(0 Reviews)
0.0
koushikcse2008

I will make all the required things and complete the task with full support even after the job done. I will also look after all the changes that you needs to make the project successful from your end. I will also make More

$23 USD in 3 days
(0 Reviews)
0.0
karmakararijit

Well versed in PHP and MYSQL. I can solve your problem. Will complete in a day. Let me know if you are interested.

$14 USD in 1 day
(0 Reviews)
0.0
Zueri

I know to code using mySql or sql. I have my experience on sql for almost 3 years. I can help your to solve the problems of your queries.

$30 USD in 1 day
(0 Reviews)
0.0
antoniomgranda

I've created several sites with this kind of queries for reports, I can do that job quickly, hope I hear about you soon =)

$27 USD in 1 day
(0 Reviews)
0.0
sotelio

You should generate first the date, according to you selection, like this: $x_month_ago = strtotime("-1 month"); Then, that number use it in your query to the database. Good luck.

$15 USD in 1 day
(0 Reviews)
0.0
tvolf

Hi I'm Stan from Moldova (Eastern Europe, UTC+3). I am an expert in MySQL and PHP which are realted to your task so your task is very interested me. I've took a look at your attached file and see that you use N r More

$25 USD in 3 days
(0 Reviews)
0.0
maxcatani

Non hai ancora fornito una proposta

$20 USD in 1 day
(0 Reviews)
0.0