List:General Discussion« Previous MessageNext Message »
From:Bryan Wheelock Date:March 16 2001 9:46pm
Subject:INSERT records into multiple tables
View as plain text  
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


Thread
INSERT records into multiple tablesBryan Wheelock16 Mar
  • Re: INSERT records into multiple tablesJason Landry16 Mar
  • RE: INSERT records into multiple tablesCal Evans16 Mar
    • Re: INSERT records into multiple tablesPatrick Calkins17 Mar