Skip to main content
Participant
February 4, 2010
Question

Inserting from a Form to multiple MySQL tables using CS4 Server Behaviors

  • February 4, 2010
  • 1 reply
  • 1282 views

Hi,

I'm trying to set up a CS4 Insert Record Server Behavior to add information submitted from a single form to two tables.

If a user submits the form they send their eMail address and a question.

So, I have two tables in the database: 1)  person with the eMail field, and 2) questions with a questions field.

Because one user can submit multiple questions at different times and days using their same eMail address, any additional questions should be added only to the questions table and linked to their foreign key.

I'd appreciate any help or reference links.

Thank you,

Andrew

This topic has been closed for replies.

1 reply

Participating Frequently
February 5, 2010

Server behaviors do not support inserting into multiple tables. The best solution for this is probably a stored procedure.

PtrlwladfAuthor
Participant
February 5, 2010

Thanks for your reply!

I'm using PHP & it doesn't look like there's support for PHP/MySQL stored procedures.  ASP, JSP and ColdFusion are supported.

David_Powers
Inspiring
February 5, 2010

Ptrlwladf wrote:

I'm using PHP & it doesn't look like there's support for PHP/MySQL stored procedures.

That's because MySQL didn't support stored procedures until version 5.0. The Dreamweaver server behaviors were created when MySQL 3.23 was the standard.

It's not something that many people like to be told, but you won't get very far at all if you rely on using Dreamweaver server behaviors. They are useful for rapid prototyping and simple operations, but if you want anything more sophisticated, you need to learn how to code it yourself.