Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8218029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T12:38:59+00:00 2026-06-07T12:38:59+00:00

I have almost the same question as this . Based on that post I

  • 0

I have almost the same question as this.

Based on that post I know that PDO::lastInsertId() is safe when called from different connections. However, does this mean PDO::ATTR_PERSISTENT => true should not be used in the PDO constructor if you want to use PDO::lastInsertId() during that connection?

In other words, if I need to use PDO::lastInsertId() is my application compelled to endure “the overhead of establishing a new connection every time a script needs to talk to a database” as documented in PDO Connections and Connection Management.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T12:39:00+00:00Added an answer on June 7, 2026 at 12:39 pm

    No, it doesn’t mean.

    Doesn’t matter who will utilize the same connection after your php script ends its work. What matters is that you will have the last inserted id that’s performed by this, not another connection.

    So feel free to use it with both persistent and not-persistent connections.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have almost the exact same question as at the following post (and I
I have almost the same problem as this unanswered question . The only difference
This is almost the same question than here , except that I am asking
I asked Almost this exact same question yesterday. Basically I have a css button
Almost the same question as this one here: What's the easiest way to grab
This is almost exactly the same as this question json get key names as
Sorry to be posting this question. :( But I have spent almost the entire
I know this question has been asked multiple number of times and i have
I have created total 50 test scripts. All these scripts use almost same objects
I have almost created a website that works in all major browsers flawlessly. Yesterday,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.