PHP create data between dates
Posted: Tue Dec 21, 2010 9:36 am
Not sure if this is possible but here goes. This is my query:
Results are as follows:
Is it possible to include days that do not exist and give them the value 0? Even null would work. Not sure if some type of range command exists.
Desired results Example:
Thanks 
Code: Select all
SELECT `time`,`protocal`,(`octet`/1024) as `octet10243`,`percent`,`div`,FROM_UNIXTIME(`time`, '%Y-%m-%d') as `newtime3` FROM ipport WHERE FROM_UNIXTIME(`time`, '%Y-%m-%d') >= '2010-11-26' AND FROM_UNIXTIME(`time`, '%Y-%m-%d') <= '2010-11-30' AND (`protocal` = 'Echo' ) AND `div` = 'XDIV'Code: Select all
"time";"protocal";"octet10243";"percent";"div";"newtime3"
"1290923100";"Echo";"92844.07421875";"1.04435";"XDIV";"2010-11-28"
"1291009500";"Echo";"95110.106445312";"1.0796";"XDIV";"2010-11-29"Desired results Example:
Code: Select all
"time";"protocal";"octet10243";"percent";"div";"newtime3"
"0";"Echo";"0";"0";"XDIV";"2010-11-26"
"0";"Echo";"0";"0";"XDIV";"2010-11-27"
"1290923100";"Echo";"92844.07421875";"1.04435";"XDIV";"2010-11-28"
"1291009500";"Echo";"95110.106445312";"1.0796";"XDIV";"2010-11-29"
"0";"Echo";"0";"0";"XDIV";"2010-11-30"