Jump to content


Photo

Hi again


  • Please log in to reply
6 replies to this topic

#1 shiva

shiva
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 07 August 2006 - 12:38 PM

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

#2 tvdhoff

tvdhoff
  • Members
  • PipPip
  • Member
  • 16 posts

Posted 07 August 2006 - 12:45 PM

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:

CREATE TABLE worktomorrow SELECT values,work,now FROM worknow;




#3 Daniel0

Daniel0
  • Staff Alumni
  • Advanced Member
  • 11,956 posts

Posted 07 August 2006 - 01:29 PM

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.


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.

#4 shiva

shiva
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 08 August 2006 - 11:33 AM

Thanks tvdhoff and Daniel0 :)

#5 Guest_edwinsweep_*

Guest_edwinsweep_*
  • Guests

Posted 08 August 2006 - 12:30 PM

hey shiva are you the one from holland zaandam????


#6 shiva

shiva
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 10 August 2006 - 06:45 AM

No:) Not from Holland

#7 Silverado_NL

Silverado_NL
  • Members
  • PipPipPip
  • Advanced Member
  • 105 posts
  • LocationZaandam (Netherlands)

Posted 10 August 2006 - 11:25 AM

No:) Not from Holland

damn
well ok
a friend of mine is called shiva!
The Force is like ductape, it has a light side, it has a dark side, and it combines the universe together!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users