Automatically add column to data table according to week

132 Views Asked by At

I'm working on a table that shows data per week. How can I automatically add a column after a week has passed by and show its data from the database? Thank you in advance.

MVC2

Jquery

1

There are 1 best solutions below

0
Da Mahdi03 On

If you meant that for every week, in real-life and not in the database, you would update the table, this can be done via JavaScript just by using new Date() and extracting the necessary information to find out how many weeks have passed and how many columns you need to add to your table. You can use jQuery's Ajax methods to fetch info from databases as well: w3schools - jQuery Ajax Methods It should work for PHP (MySQL) Databases and ASP related Databases!

Hope that helps!