you can't. You have to do 2 seperate inserts. (Sorry)

Cal
http://www.calevans.com


-----Original Message-----
From: Bryan Wheelock [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 16, 2001 3:47 PM
To: [EMAIL PROTECTED]
Subject: INSERT records into multiple tables


I'm just learning how to use MySQL and I am searching for a more simple way
of doing an INSERT query into multiple tables simultaneously.
I have done my best to nominalize my DB but that creates but I'm confused as
to how to insert data into the DB and have all the related table be updated.
I think that I can work out some way using conditional statements in PHP to
insert the data into all the records, but I'm thinking there must be a more
elegant and faster way of doing this.

e.g.
table people
1    Bryan    student
2    Jill         teacher
3     Bob     student

table job
1    student
2    teacher

If I want to insert a record to table PEOPLE :
insert into people values('4', 'Jon', doctor)

How can I do this without having to also do a separate insert into table
JOB?




You need to Understand the rules so you can break them intelligently,"
the Dalai Lama



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to