Forum Moderators: open

Message Too Old, No Replies

Does This Already Exist? Please help.

Existing Code - HTML Table - Use SQL?

         

briandw

7:17 pm on Apr 9, 2008 (gmt 0)

10+ Year Member



Could someone please point me in the right direction? I assume some HTML or PHP code which performs the following function probably already exists somewhere - or can someone please advise me as to the best way to do this (It's really easy, but I need to know the best way to do this). Here goes:

I made an HTML table that looks something like this:

DATE..Jan1.Jan8.Jan15.Jan22... WeekChange TotalChange
--------------------------------------------------------------
VarA...10....16.....28..........................12.........18
--------------------------------------------------------------
VarB...17....30.....45..........................15.........28
--------------------------------------------------------------

The idea is as follows: on a weekly basis, a person goes to the webpage and types in "today's values" for "Variable A" and for "Variable B". The table then computes the change since last week's value, and the change since the date of the first measurement (Jan1).

Simple, not a problem, that part's already done. Now here's my question: what's the best way to handle this data, so the person can easliy retrieve it and add additional data next week? Should the data from the HTML table get saved into an SQL database? Should I have the data from the SQL database generate and populate an updated HTML table like the one above every time the person visits this webpage? Is there already an application or some existing HTML (or PHP) code I could use that already does this type of function?

Any suggestions would really be greatly appreciated. Or if anyone has a short piece of code that already does this, I would love to use it.

Thank you very much, and everyone have a great day.

BrianDW

coopster

6:21 pm on Apr 10, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, briandw.

A few questions come to mind such as ...

How much data do you intend to store?
Will it be the same for every visitor?
Or will each visitor be able to set their own information?
How long will you keep the data?
Will it roll over or be purged?

Storing information in a database or even just a text file on your server is one option. You can store data in a cookie as well, if the user allows you to set a cookie and they don't clear it out at any point (otherwise they lose their data, it would be stored on their machine, not your server). Answering questions like those posted above will help you determine the best option.

SuperKitten

1:03 pm on Apr 30, 2008 (gmt 0)

10+ Year Member



Well, i believe that php/mysql is perfectly designed to solve this problem :)