Hello! I am spanking new to PHP & MySQL but I am learning fast. I have searched the boards but haven't found anything to my liking regarding this question:
(Using MySQL and PHP)How do I change data in 2 tables in the SAME DB simultaneously?
For example:
Table1 has Joe with 2 apples
Table2 has Mike with 1 apple
Joe sells and apple to Mike..
and now Mike has 2 apples and Joe has 1
Does PHP take care of this math equation or will I need JS to do it? Also the new results (data)needs to be STORED in the same tables indefinately until the next time these 2 Tables do business again or perhaps a new person (Table3) comes along?
I hope my analogy works with what I am trying to get at?
If that was too easy I have a followup question!
With the same example I would like to keep a history of these results in 2 other tables in the same DB. These tables are "MonthSales" and "Weeklysales".
So how can I take the new STORED data in each persons table and COPY it to another table - that will ADD the WEEKLY number of SALES these guys sold? (And MONTHLY)
Much thanks to all!
-Paul