Hi I have a report.php page where when i click a link, the sql statement will be executed and results will be exported to csv file. To display the links (for example every monthly report) [Jan report] [Feb report] [Mar report] i use this code : $lst_csv = array( 'List - Jan 2013'=> array( 'table'=>'tbl_jan', 'where'=>"WHERE v_id=12", 'db'=>'main', 'select'=>'name,id'), 'List - Feb 2013'=> array( 'table'=>'tbl_feb', 'where'=>"WHERE v_id=12", 'db'=>'main', 'select'=>'name,id'), 'List - Mar 2013'=> array( 'table'=>'tbl_mar', 'where'=>"WHERE v_id=12", 'db'=>'main', 'select'=>'name,id'), according to the current setup every month i need to add 1 portion for that month. Is there anyway i can add all 12 portion for all 12 months, but the array will display the link only if the current month is <= list month. Lets say i list down the link for all 12 months in 2013. If i run the php now, it should display link for Jan 2013 only. Any idea? Thanks
I'm not realy getting your point, you can work with date("m") to check current month and use if statement to check if you need to include that part of the array or not?
how can i do that? ok this is what i want -------------- Report.php -------------- Output : Jan 2013 Feb 2013 Mar 2013 Apr 2013 May 2013 June 2013 July 2013 Aug 2013 Sep 2013 Oct 2013 Nov 2013 Dec 2013 -------------- I need something like that as output, every month is a link, when i click a sql statement will be executed and csv file will be exported. now when im in Feb (actual month) the output page should only display Jan 2013. Lets say next month the out put should be Jan 2013 and Feb 2013 only... how can i set a if condition inside an array? Thanks