Yeah, this is why some people like the idea of having transaction supports
in the tables, to make sure both the inserts to the two tables succeed, or
none of them do. Currently MyISAM does not support this, only the newly
introduced Berkeley DB tables support this feature although it is assumed
quite a bit slower than the native MyISAM tables (albet a bit buggier as
well)...

Good luck!
Patrick

> 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
>


---------------------------------------------------------------------
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