Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to update one table and insert into another

Guest
Oct 10, 2007 Oct 10, 2007
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.
TOPICS
Server side applications
374
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Oct 10, 2007 Oct 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 r...
Translate
LEGEND ,
Oct 10, 2007 Oct 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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 10, 2007 Oct 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.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 10, 2007 Oct 10, 2007
you wrote: "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."

Can you explain that? From what I see I can only perform whatever SQL I can write in the server behavior given the framework that DW provides. If I could use stored procedures I could do a whole lot more and call lots of procedures, but stored procs are not supported by DW if you are using PHP/MySQL.


quote:

Originally posted by: 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



Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 10, 2007 Oct 10, 2007
On Wed, 10 Oct 2007 21:45:36 +0000 (UTC), "davidbarrackphoto"
<webforumsuser@macromedia.com> wrote:

>you wrote: "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."
>
> Can you explain that? From what I see I can only perform whatever SQL I can
>write in the server behavior given the framework that DW provides.

You can go into code view and write anything. DW can't do this for
you. Just find the place after the Update code (and before the page
redirection) and add your Insert code. If necessary, do what you want
using two forms on a test page and cut/paste the relevant code as I've
indicated.
--
Steve Fleischer
steve at flyingtigerwebdesign dot com
Hong Kong
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 11, 2007 Oct 11, 2007
LATEST
davidbarrackphoto wrote:
> If I could
> use stored procedures I could do a whole lot more and call lots of procedures,
> but stored procs are not supported by DW if you are using PHP/MySQL.

Just enter the Stored Procedure code in the SQL field of the Advanced
Recordset dialog box.

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines