Check out last_insert_id in the manual.

----- Original Message -----
From: "Jorge Oliveira" <[EMAIL PROTECTED]>
To: "Mysql@Lists. Mysql. Com" <[EMAIL PROTECTED]>
Sent: Friday, June 08, 2001 7:43
Subject: INSERT.


> Hi,
>
> I have two tables in my database:
>
> #TB1
>   ID_tb1 (auto-incremented)
>   ID_tb2
>   name
>   address
>
> #TB2
>   ID_tb2 (auto-incremented)
>   method
>   status
>
> I need to run a query that inserts values into #TB1 and #TB2, having
> #TB1.ID_tb2 equal to #TB2.ID_tb2.
>
> Since #TB2.ID_tb2 is auto incremented, I don't know how to get the same
> value inserted at #TB1.ID_tb2...
>
>
> Thanks in advance.
>
>
> Best Regards,
>
> Jorge Oliveira
> [EMAIL PROTECTED]
>
> -------------------------------------
> © webfroggie.com - Recursos Online!
> web: http://www.webfroggie.com
> wap: http://www.webfroggie.com
>
>
>
> ---------------------------------------------------------------------
> 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