How to switch between Session 2012-13, 2013-14..and so on in mysql and php?

mksharmil
03:10:13
I want to create a page in php and mysql that opens data related to 2012-2013 if I select session 2012-2013. and if I select session 2013-2014 it should select another database related to 2013-14. can it be possible?
A company can have many years of data so how to select them by sessions?
smo1234
03-10-2013
All are possible. But do you mean selecting two different database or two different table based on the session selection ?
You can check the selected session by using one if condition or switch condition. Keep the code block for each session inside one switch or if condition. Based on the checking or output of if or switch condition the respective code block will be executed.
mksharmil
03-10-2013
@smo1234, the previous program was built in vb6 so there are 3 or 4 databases as 001.2012-2013,
001.2013-2014,
001.2014-2015..
first i'll have to restore all the data in mysql and then I will create a php base project,so explain and suggest which one will be the best.
smo1234
03-10-2013
Try to import them to one database. If possible keep them in one table. So you can query them based on requirement.

select * from table_name where year (session ) between 2013 and 2014

Read more how to use date range inside query here.
mksharmil
03-11-2013
Oh So Nice of you Sir, Thanks a lot. Its done!!!
Please Login to post your reply or start a new topic