Skip to main content
Oct 10, 2007 7:47 PM UTC
Answered

How to update one table and insert into another

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 is closed to new replies. Start a new post to keep the conversation going.
Newsgroup_UserCorrect answer
Inspiring
Oct 10, 2007 7:52 PM UTC
.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

5 replies

Newsgroup_UserCorrect answer
Inspiring
Oct 10, 2007 7:52 PM UTC
.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
Translate
Oct 10, 2007 9:42 PM UTC
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.
Translate