Hi,
I have two related tables in mysql database and both use the same foreign key. I want to put both tables under one submit form so that the data supplied can go to both tables with no errors.
How can do that?
How to submit data into two tables in mysql
Started by kwesiaryee, Oct 10 2008 02:52 AM
6 replies to this topic
#1
Posted 10 October 2008 - 02:52 AM
|
|
|
#2
Posted 10 October 2008 - 04:48 AM
kwesiaryee said:
Hi,
I have two related tables in mysql database and both use the same foreign key. I want to put both tables under one submit form so that the data supplied can go to both tables with no errors.
How can do that?
I have two related tables in mysql database and both use the same foreign key. I want to put both tables under one submit form so that the data supplied can go to both tables with no errors.
How can do that?
I think you should visit the Java Help forum :)
http://forum.codecall.net/java-help/
#3
Guest_Jordan_*
Posted 10 October 2008 - 04:54 AM
Guest_Jordan_*
I've moved your thread, please do not post questions in the tutorial section. Thank you Turk4n for letting us know.
I moved your question to the Java section because you had it in the Java Tutorials section, however, your question involves MySQL which is commonly used in Web Development rather than desktop/Java development. What language are you trying to connect to the MySQL database with?
I moved your question to the Java section because you had it in the Java Tutorials section, however, your question involves MySQL which is commonly used in Web Development rather than desktop/Java development. What language are you trying to connect to the MySQL database with?
#4
Posted 10 October 2008 - 05:04 AM
Jordan said:
I've moved your thread, please do not post questions in the tutorial section. Thank you Turk4n for letting us know.
I moved your question to the Java section because you had it in the Java Tutorials section, however, your question involves MySQL which is commonly used in Web Development rather than desktop/Java development. What language are you trying to connect to the MySQL database with?
I moved your question to the Java section because you had it in the Java Tutorials section, however, your question involves MySQL which is commonly used in Web Development rather than desktop/Java development. What language are you trying to connect to the MySQL database with?
Np, Jordan and thanks for moving it !
#5
Posted 10 October 2008 - 08:11 AM
Just collect all the data you need, and then run the two insert statements.
#6
Posted 10 October 2008 - 09:07 AM
I am connecting with java: connection pool to mysql
#7
Posted 10 October 2008 - 08:45 PM
As winged said, you need 2 insert statements. Since you will be connecting to 2 tables, use the mysql table select command to select each table then insert the appropriate values.


Sign In
Create Account

Back to top









