khalid Posted July 25, 2011 Share Posted July 25, 2011 Hello, I'm really hoping someone can help with a solution to a problem I have... I have a comments box that records input with date, time and username. This is displayed in order of date and record in one table. E.g. Username: Khalid Comment: Hello Date: 27th July 2011 13:00 I have another table that records financial values via a different input area. E.g. Username: Khalid Gross Sale: £5,000 Loan Value: £2,500 Cash Value: £2,500 Date: 27th July 2011 13:00 I want to be able to mix the tables in some form so when a financial value is recorded it is displayed as a comment in the comments table. The financial values are on a separate table so they can be pulled and statistics formed of total sales etc. Can anyone suggest a way so that either the financial value(s) are duplicated as a comment or inserted as a comment but also accessible for the creation of statistics etc? Thanks in advance! Quote Link to comment https://forums.phpfreaks.com/topic/242734-mixing-tables-in-chronological-order/ Share on other sites More sharing options...
teynon Posted July 25, 2011 Share Posted July 25, 2011 Is it possible to have the financial records insert a comment when it is created? Quote Link to comment https://forums.phpfreaks.com/topic/242734-mixing-tables-in-chronological-order/#findComment-1246717 Share on other sites More sharing options...
khalid Posted July 25, 2011 Author Share Posted July 25, 2011 yes...but how would i do that? Quote Link to comment https://forums.phpfreaks.com/topic/242734-mixing-tables-in-chronological-order/#findComment-1246719 Share on other sites More sharing options...
Muddy_Funster Posted July 25, 2011 Share Posted July 25, 2011 Add an insert into for the comments table into the sql you are using for the financials one. Quote Link to comment https://forums.phpfreaks.com/topic/242734-mixing-tables-in-chronological-order/#findComment-1246762 Share on other sites More sharing options...
khalid Posted July 25, 2011 Author Share Posted July 25, 2011 Is there any way of simply adding a function so that when data is inserted into the financial table it automatically inserts a comment to the comments table? Quote Link to comment https://forums.phpfreaks.com/topic/242734-mixing-tables-in-chronological-order/#findComment-1246770 Share on other sites More sharing options...
Muddy_Funster Posted July 25, 2011 Share Posted July 25, 2011 Yes....how about: Add an insert into for the comments table into the sql you are using for the financials one. Quote Link to comment https://forums.phpfreaks.com/topic/242734-mixing-tables-in-chronological-order/#findComment-1246774 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.