Correct my code (3x MYSQL queries) to display results correctly
$10-30 USD
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.
Project ID: #8593219
About the project
Awarded to:
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
18 freelancers are bidding on average $22 for this job
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
Dear sir, please contact me. We will discuss about your requirements. When I understand your requirements, I'll fix them for you.
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
Codes are ready for you to check whether it is working as you expected...............................
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
I had experience with mySQL/Php programming. Looking forward to getting this as my first project for my portfolio here.
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
Well versed in PHP and MYSQL. I can solve your problem. Will complete in a day. Let me know if you are interested.
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.
I've created several sites with this kind of queries for reports, I can do that job quickly, hope I hear about you soon =)
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.