I am trying to use PDO's lastInsertId method, but the documentation states that for some rdbms I need a sequence name as an argument. Only being familiar with mysql, I am not quite sure what a sequence name is. Do they mean the name of the column that contains the auto-increment id? Here is the documentation for the method:
http://php.net/manual/en/pdo.lastinsertid.php
Any information on this would be greatly appreciated. Thanks.
Instead of having a primary key auto_increment
ing (i.e. MySQL), you can create a named sequence like this:
CREATE SEQUENCE a_sequence INCREMENT BY 5 START WITH 30
So you'd have a column with these values: 30, 35, 40... etc. The lastInsertId method should grab the last sequence value.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With