Copy link to clipboard
Copied
How do I create a page in dreamweaver that comes up after the user logs in from the log in page that will allow the user to:
Add, change and delete in 2 tables that are in my MYSQL database that is a one to many relationship
One thing that is confusing is how the foreign key that links to the one side of the relationship is created in the many side without the user inputting the foreign key each time adding information to the many side table.
I am creating this in Dreamweaver using a MYSQL database and PHP.
Copy link to clipboard
Copied
I would use a stored procedure to handle this. AFAIK, Dreamweaver behaviors do not handle multiple table updates/inserts.
Copy link to clipboard
Copied
Can you tell what the stored procedures would be?
Would the following be a part of it:
Outer join
set
Copy link to clipboard
Copied
I have moved this thread to the Dreamweaver Application Development forum, which is the appropriate place for discussion of database and other server-side issues.
Paulbreininger wrote:
Can you tell what the stored procedures would be?
Before asking that question, you need to establish whether your version of MySQL supports stored procedures. They were added to MySQL only in version 5.0. Many hosting companies are still running older versions.
The other point you need to take on board is that Dreamweaver's PHP server behaviors don't support stored procedures. Whichever route you finally take, you will need to code everything yourself.
Copy link to clipboard
Copied
>Would the following be a part of it:
>
>Outer join
Probably not. When updating/inserting/deleting from 2 tables you perform each seperately. Table updates may join two or more tables to resolve the correct row(s) but you still only update one table at a time. Procedurally you would create a transaction, update the first table, update the second table and then commit the transaction.
EDIT: Well I take back my last comment. I see that MySQL does seem to support multiple table updates. I don't use MySQL so I can't really help you on that but the MySQL manual gives pretty clear syntax.
Copy link to clipboard
Copied
In order to use SQL, you should know something about database design. Do a Google search for something like "how to design a database."