#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2000
    Posts
    0
    Rep Power
    0
    For example I insert row into base (MySQL). The first field id - an primary key generate also is inserted itself autoincrement.
    As after an insert at once to receive this number for inserting in other table.
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2000
    Location
    Norfolk, UK
    Posts
    9
    Rep Power
    0
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by dema501:
    For example I insert row into base (MySQL). The first field id - an primary key generate also is inserted itself autoincrement.
    As after an insert at once to receive this number for inserting in other table.
    [/quote]

    Use the LAST_INSERT_ID() function.

    - Glen
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2000
    Posts
    0
    Rep Power
    0
    Maybe it better
    $dbh->{'mysql_insertid'};

IMN logo majestic logo threadwatch logo seochat tools logo