What is considered 'multiple clients' - LAST_INSERT_ID().

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    What is considered 'multiple clients' - LAST_INSERT_ID().

    The MySQL manual states:

    Using LAST_INSERT_ID( ) and AUTO_INCREMENT columns simultaneously from multiple clients is perfectly valid. Each client will receive the last inserted ID for the last statement that client executed.
    I wonder what is considered a 'client'. Is that simply just different connections to the database?
  • dlite922
    Recognized Expert Top Contributor
    • Dec 2007
    • 1586

    #2
    Well don't know but it seems to work, so IMHO it's same to assume that's what a client means.

    If it wasn't true if two people were using the app and both say...new users. the first user wouldn't get the first user's auto_increment ID.


    Dan

    Comment

    • mwasif
      Recognized Expert Contributor
      • Jul 2006
      • 802

      #3
      Originally posted by Markus
      The MySQL manual states:
      I wonder what is considered a 'client'. Is that simply just different connections to the database?
      Yes, each connection to MySQL will be considered a separate client.

      Comment

      • Markus
        Recognized Expert Expert
        • Jun 2007
        • 6092

        #4
        Originally posted by mwasif
        Yes, each connection to MySQL will be considered a separate client.
        Thanks for the clarification!

        Comment

        • dlite922
          Recognized Expert Top Contributor
          • Dec 2007
          • 1586

          #5
          That's what I just said! :)

          j/k



          Dan

          Comment

          • Markus
            Recognized Expert Expert
            • Jun 2007
            • 6092

            #6
            Originally posted by dlite922
            That's what I just said! :)

            j/k



            Dan
            I was thanking both of you, I just couldn't reply to you both (without more clicking).

            ;D

            Comment

            Working...