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
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.