Is it possible to use PDO lastInsertId when the table was previously locked?

+1 vote
asked Mar 16, 2016 by Mince_ven (290 points)
I hope you can help me

5 Answers

0 votes
answered Jun 2, 2016 by Plosker3976 (550 points)

If the table name is already quoted, this method will do nothing. A simple table name should contain the table name only without any schema prefix.
Null if the named table does not exist. The table name may contain schema name if any.
commented Jun 3, 2016 by each6465 (380 points)
FYI: Used two DB shell sessions and a table with a serial field
commented Jun 4, 2016 by mercik (150 points)
Maybe someone facing this problem. Most of the features are still there but they have of course removed a bit
0 votes
answered Jun 2, 2016 by Vf994Then (180 points)

Drupal implements these with a table for mysql.
Specifically, lastInsertId only sometimes works.
Inserted a record into the table from each session then called currval. Details for this specific function can be found at Getting rid of the sequences table, using db_last_insert_id() instead of db_next_id() [#49836] |
0 votes
answered Jun 2, 2016 by wanzek_purp (150 points)
If you are really interested in why part, you can visit Schema, yiidbSchema - Yii Framework 2.0 API Documentation for more details
0 votes
answered Jun 2, 2016 by that9823 (140 points)
You can generate hashes using this encryption scheme at Roll your own PDO PHP Class | Culttt
See this example for more details
0 votes
answered Jun 2, 2016 by Zbf_7042 (270 points)
What would this statement yield
Check this solution here Managing hierarchical data in MySQL - closure table on ...
commented Jun 4, 2016 by whatLampson (360 points)
Look at ADOdb or phpBB DBAL

What is Geekub?

Q&A site for professional and enthusiast programmers, software developers and other technical users. With your help, we hope to work together to build a library of detailed answers to just about any question that is related to programming!