Jump to content

Hi again


shiva

Recommended Posts

I did some studying on PHP and now can create tables, connect to mysql, send arguments etc... know about _get and _post also.... now my question  is....Hhow to manipulate table data so that I can choose values from a set of different tables, may be apply a formula and then display results in another table?

For example, I would like to take "work_done" from yesterday's table and add it to "work done" in today's table and display it as "total work completed" in a third table.

Hints, tips or answers would be appreciated :)


Thanks in advance :)
Shiva
Link to comment
https://forums.phpfreaks.com/topic/16790-hi-again/
Share on other sites

Hi,

You don't need extra tables: you could add an extra column called 'status' and give each of those possibilities a value, ie. 'Work Done' = '1', 'In Progress'=2 etc. You could create an extra table to store those status IDs and add a column for the names that go with it.

If you really want to store it in a new table you would need to make a combined create table and select statement, like:

[code]
CREATE TABLE worktomorrow SELECT values,work,now FROM worknow;
[/code]

Link to comment
https://forums.phpfreaks.com/topic/16790-hi-again/#findComment-70625
Share on other sites

[quote author=shiva link=topic=103278.msg411154#msg411154 date=1154954339]For example, I would like to take "work_done" from yesterday's table and add it to "work done" in today's table and display it as "total work completed" in a third table.[/quote]

Instead of having one table per day, you could have an extra field in the table called date, and then store the day or a UNIX timestamp in that field.
Link to comment
https://forums.phpfreaks.com/topic/16790-hi-again/#findComment-70657
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.