pulling Primary Key from mysql right after INSERT

Discussion in 'PHP' started by axemedia, Oct 10, 2007.

  1. #1
    as I create a new row of data into mysql, the primary key of the table gets generated via AUTO INCREMENT right then and there.

    In the next step in my php script I want to pull that primary key (SELECT) from that latest row of data I just created. How do I do that?

    do I have to use another set of unique data from other columns in that same row, like date and time maybe so mysql can reference only the row I want it from?
     
    axemedia, Oct 10, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    nico_swd, Oct 11, 2007 IP
    axemedia likes this.
  3. axemedia

    axemedia Guest

    Messages:
    1,070
    Likes Received:
    79
    Best Answers:
    0
    Trophy Points:
    0
    #3
    axemedia, Oct 12, 2007 IP