vishak Posted May 14, 2010 Report Posted May 14, 2010 Hello, I have a table with fields date,day,and some data for each day. I want to display the data on a weekly basis, (ie from Monday to Friday) along with options for next week and previous week. Could someone help me with this? Quote
falkencreative Posted May 14, 2010 Report Posted May 14, 2010 Are you building a static website, just using HTML and CSS, or are you pulling this information from a database (and using something like PHP)? I recently did a tutorial on using PHP/MySQLi to do pagination (source code is here: http://www.killersites.com/community/index.php?/topic/3064-basic-php-system-view-edit-add-delete-records-with-mysqli/ and the two part screencast is on the KillerSites University http://www.killersites.com/university under PHP > Misc PHP). That may give you a direction to go, since pagination is pretty similar to what you want to do. Quote
jmb272 Posted May 14, 2010 Report Posted May 14, 2010 Hello, I have a table with fields date,day,and some data for each day. I want to display the data on a weekly basis, (ie from Monday to Friday) along with options for next week and previous week. Could someone help me with this? Why not get a twitter account and build/download a script to display your latest tweets? Quote
falkencreative Posted May 14, 2010 Report Posted May 14, 2010 Why not get a twitter account and build/download a script to display your latest tweets? Assuming that @kiddo is trying to build something calendar related, I'd imagine that it would need to have dates and events in the future, which isn't possible with Twitter. Quote
vishak Posted May 16, 2010 Author Report Posted May 16, 2010 What I am storing is some data for each day of the month. I want to retrieve it week by week.It should include a next week and previous week button,so that a user can navigate accordingly. That's what i have in mind. At present I have done it using a vertical scroll bar and included the entire information. Quote
falkencreative Posted May 16, 2010 Report Posted May 16, 2010 What I am storing is some data for each day of the month. I want to retrieve it week by week.It should include a next week and previous week button,so that a user can navigate accordingly. That's what i have in mind. At present I have done it using a vertical scroll bar and included the entire information. Are you building a static website, just using HTML and CSS, or are you pulling this information from a database (and using something like PHP)? Quote
vishak Posted May 16, 2010 Author Report Posted May 16, 2010 I had mentioned in my first post that I am using a table, so of course a database. Sorry If hadn't posted it explicitly. My table structure is like this date day ........data........... 2010-01-02 Monday 2010-01-03 Tuesday 2010-01-04 Wednesday 2010-01-05 Thursday 2010-01-06 Friday 2010-01-07 Monday 2010-01-08 Tuesday 2010-01-09 Wednesday And now i have to display data week by week,after reading from the database.For example if today is 2nd of January (assume it is a monday)then display data till friday(till 6th of Jan). Then have a next and previous week button to display data accordingly. Quote
falkencreative Posted May 16, 2010 Report Posted May 16, 2010 Sorry, I think I read table as "HTML table" and missed that. Probably the easiest way to do things would be to assign each week an week value which you can pass via the url: yourpage.php?week=2. Based on the id value, PHP would determine which week you want to show (in this case, days 8-14 of January) and display them. Your previous week link would be "yourpage.php?week=1" and your next week would be "yourpage.php?week=3". You could also build in support for different years as well -- perhaps "yourpage.php?week=3" would default to 2010 since that's the current year, but if you add an additional value in the url, "yourpage.php?week=3&year=2011" it would specify the year as well. I obviously don't have a specific example using a calendar, but you might want to look at http://www.killersites.com/community/index.php?/topic/3064-basic-php-system-view-edit-add-delete-records-with-mysqli/ (or there's a link in that article to a version that uses regular mysql) where I explain some pagination basics. For the mysql query where you grab the data from the database, using LIMIT can be helpful. http://php.about.com/od/mysqlcommands/g/Limit_sql.htm Quote
Guest premeet01245 Posted May 22, 2010 Report Posted May 22, 2010 hai I am new here I want to more about it Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.