simon551 Posted May 7, 2007 Share Posted May 7, 2007 What I am trying to accomplish doesn't seem totally unique so it very likely the way I am asking the question which is keeping me from finding the answer. This is an expense report problem. I have 3 tables that make up an expense report: expensereport, erDets, and erSplits. The reason for the 3rd table is that in some cases the employee will need to split an expense into multiple lines due to multiple projects being covered by one expense item. What I want to do is create an interface that makes it seem like the user is entering into just 2 tables (expensereport, details) so the need I have is to combine the 2 tables (erDets, erSplits) into one form -- or at least the appearance of one form. an idea I have is to have just one button that submits both forms. Could I make a button that when clicked would do the following? 1. query one: insert into erDets (form1) 2. retrieve the newly created key --$var = mysql_insert_id() 3. query two: insert into erSplits ($var, form2) Maybe there is a better way to accomplish this? Quote Link to comment https://forums.phpfreaks.com/topic/50418-solved-submit-multiple-forms-at-once/ Share on other sites More sharing options...
Barand Posted May 7, 2007 Share Posted May 7, 2007 Why 2 forms anyway? What do they look like? Quote Link to comment https://forums.phpfreaks.com/topic/50418-solved-submit-multiple-forms-at-once/#findComment-247643 Share on other sites More sharing options...
simon551 Posted May 7, 2007 Author Share Posted May 7, 2007 I guess because currently that's as far as my understanding goes: I can submit a form into a table. I can retrieve the newly-created key field. and then I can use that key field in another form. I don't know how to do it all in one step. One form would be great. Maybe that is what I should be looking at. Quote Link to comment https://forums.phpfreaks.com/topic/50418-solved-submit-multiple-forms-at-once/#findComment-247645 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.