PHP PDO::lastInsertId() and ATTR_PERSISTENT -


I have almost one question.

Based on that post, I know that PDO :: The last InsertID () is called when a separate connection is safe. However, what does this mean by PDO :: ATTR_PERSISTENT = & gt; Should the correct should be not in the PDO constructor if you want to use PDO :: Previous Industry () during that connection?

In other words, if I use PDO :: lastInsertId (), my application "documents every time a script needs to talk to a database" as "a new one Connection is forced to bear on top of the setting.

No matter Who will use the same connection after the work of your php script. That you will have the last entered ID that is done by it, and not another connection.

So do not hesitate to experiment with this both continuous and continuous connections. < / Div>

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -