So i'm doing a query for sales data and my return array looks like this
('date' => '2008-11-01 00:00:00', 'total' => 1),
('date' => '2008-11-03 00:00:00', 'total' => 3),
('date' => '2008-11-04 00:00:00', 'total' => 3),
('date' => '2008-11-07 00:00:00', 'total' => 5),
('date' => '2008-11-12 00:00:00', 'total' => 1)
There are obviously gaps in my dates. What i'm trying to figure out is the best approach to filling those empty dates with a total of 0 so my graphs don't look all jacked up because i'm not providing all the data. Does anyone have an idea how to approach this problem to fill in the missing dates? I'd like the array to look like the following:
('date' => '2008-11-01 00:00:00', 'total' => 1),
('date' => '2008-11-02 00:00:00', 'total' => 0),
('date' => '2008-11-03 00:00:00', 'total' => 3),
('date' => '2008-11-04 00:00:00', 'total' => 3),
('date' => '2008-11-05 00:00:00', 'total' => 0),
('date' => '2008-11-06 00:00:00', 'total' => 0),
('date' => '2008-11-07 00:00:00', 'total' => 5),
('date' => '2008-11-08 00:00:00', 'total' => 0),
('date' => '2008-11-09 00:00:00', 'total' => 0),
('date' => '2008-11-10 00:00:00', 'total' => 0),
('date' => '2008-11-11 00:00:00', 'total' => 0),
('date' => '2008-11-12 00:00:00', 'total' => 1)
how to export excel file in same server
My first post - php newbie, so appreciate your support.I'm currently using headers to save web page as excel file.$filename="sms.xls";header("Pragma: public");header("Expires:
Array help
Hello i got this code to fetch data from database but it is not working it displays7ArrayArrayArrayArrayArrayArrayCode: if (isset($_POST['showrecord'])){ $query='SELECT * FROM artus_test';
Product categories for registration
Dear all,
output_buffering so rewrite
I'm planning to rewrite some of my scripts so they don't have to use output buffering to accomplish their form validation and html displays......so what rules should i follow when rewriting it so i
Header redirect
Hello ive got a problem ive got form with its action set to itself.Code: <form id="formID" class="formular" method="post" action=""/>it then runs
Internal class functions don't seem to get executed.
Hi. Can someone please put me out of my misery on this. I don't write much PHP and this has me baffled. I've probably work myself into the wrong mindset with the time I've spent on this. What's
problems with script
I made a small script wich exchanges points in my website: <?phpsession_start();include_once"config.php";$username = $_SESSION['username']; if(isset($_POST['exchange'])){$spoints =
I didnt code this but I need help with it
I'm sorry. i'm not a coder. I have this script for forcing download and previewing mp3. The guy that coded it made it so It took the spaces out of the filename when its downloaded. When you download a
search query in mysql in php problem
my search query wont work, i know, that my codes are correct.please helpCode: [Select]<table width="300" border="0" align="center" cellpadding="0"
PHP switch function help
Hi, I am trying to create a search function for a directory website. On the search function on html page I have a dropdown menu. From this you can select one OF 3 options - shoes, handbags, shoes and