Skip to main content
October 10, 2007
Answered

How to update one table and insert into another

  • October 10, 2007
  • 1 reply
  • 373 views
I need to update one table and also insert into a different table and want to do it in the same form. I can break this apart into 2 different forms but it's clunky for the user. Is there a common way to address this? As background, the user is updating the status of a message (ie, changing from open to closed) and then providing a reply. The reply table is separate from the message table because it's format is do different.

Thanks and sorry for bombarding the forum today.
This topic has been closed for replies.
Correct answer Newsgroup_User
.oO(davidbarrackphoto)

>I need to update one table and also insert into a different table and want to
>do it in the same form. I can break this apart into 2 different forms but it's
>clunky for the user. Is there a common way to address this?

You can do whatever you like in your form processing script. But for
many more advanced things you'd have to write your own code.

>As background,
>the user is updating the status of a message (ie, changing from open to closed)
>and then providing a reply. The reply table is separate from the message table
>because it's format is do different.

Just curious: What's the difference? IMHO there should be only one table
for the messages. Can you post some more details about this?

Micha

1 reply

Newsgroup_UserCorrect answer
Inspiring
October 10, 2007
.oO(davidbarrackphoto)

>I need to update one table and also insert into a different table and want to
>do it in the same form. I can break this apart into 2 different forms but it's
>clunky for the user. Is there a common way to address this?

You can do whatever you like in your form processing script. But for
many more advanced things you'd have to write your own code.

>As background,
>the user is updating the status of a message (ie, changing from open to closed)
>and then providing a reply. The reply table is separate from the message table
>because it's format is do different.

Just curious: What's the difference? IMHO there should be only one table
for the messages. Can you post some more details about this?

Micha
October 10, 2007
The initial 'message' consists of some free text, but then many other attributes that the user fills out to more fully describe the problem. The "reply" does not contain any of the attributes and only has free text along with a few other fields. If I combined this into one table there would be lots of unused space and because there can be many, many replies to a single message it's easier to have a "reply" table where all replies link back to the original message.