Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

php - Finding the first and last days of each month in the period of time -


i have task make website article stats based on database results. need calculate amount of articles added monthly , pass these results javascript stats function.

the first i'm doing finding entire period in articles have been added:

select min(date) startdate articles limit 1   select max(date) enddate articles limit 1 

now have period starts $startdate , ends $enddate. these variables unix timestamps in database. column date in database unix timestamp.

next, should find amount of articles have been added in each month doing query in foreach loop like:

select count(id) total articles      date > ".$startmonth." , date < ".$endmonth 

but make need find first , last days of each month in period. , stucked @ moment. please can please suggest me how find these first , last days array. think should make strtotime("+1 month",$date) in while loop until $startdate equals $enddate. in advance.

upd. there total 46 articles in database. willing have results grouped month:

select date, count(id) total `articles`   `author`=$author      group date_format(date, '%y-%m') 

results: month posts 11-2010 13 12-2010 33

it seems can achieve using group by, like

select date_format(`date`, '%y-%m'), count(id) total  articles  group date_format(`date`, '%y-%m'); 

and not need date boundaries ...


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -