Hi,
i am using Postgres Database and PHP in my Project, i have got some doubts regarding Month and Year functions.
I am passing Date(17-Feb-2004) to my PHP Page,
I want to Calculate, Monthly & Yearly Reports based on Input.
Suppose we have Orders table, (in that we have OrderNo, OrderDate, CustomerName etc)
I need to know, in Feb how many orders i got? and in January etc etc.
and also i will input Year from Combobox like 2000,2002,2003.
I need to know how many Orders i got in Year 2000,.. Year 2002 etc etc, based on Year Input.
Month and Yearly Reports
Moderator: General Moderators
Please elabourate on how PHP receives the data.
Are you passing the date in an array? As part of the general order-array?
Is it somehow akin to this:
?
For working with dates in general, have a look at [php_man]mktime[/php_man], [php_man]strftime[/php_man] and [php_man]date[/php_man].
Are you passing the date in an array? As part of the general order-array?
Is it somehow akin to this:
Code: Select all
$orders["productNumber"]=192834;
$orders["description"]="Funny Bunny"
$orders["ordered"]="17-Feb-2004"For working with dates in general, have a look at [php_man]mktime[/php_man], [php_man]strftime[/php_man] and [php_man]date[/php_man].
hmmm... you can do something like:
Don't know whether it would work in Postgres, but in MySQL it works like a charm 
Code: Select all
select concat(year(dateinsert),'-',month(dateinsert)),count(*) from Order group by concat(year(dateinsert),'-',month(dateinsert))Elobrate
Hi patrikG,
I am just using JavaScript Date Picker for Passing the Date to PHP date..
The only Variable i am passing is "Date", no other. By passing date i wna to view monthly and yearly Reports from Postgres Database.
Tq,
I am just using JavaScript Date Picker for Passing the Date to PHP date..
The only Variable i am passing is "Date", no other. By passing date i wna to view monthly and yearly Reports from Postgres Database.
Tq,