|
Posted by Pugi! on 09/09/06 12:52
In a mysql database you have a table, with an integer as primary key. You've
specified auto_increment.
Using PEAR to access your database how do you get hold of the value of the
primary key of a row you just inserted ?
The PEAR manual mentions sequences, but that is something outside of the
table you are using. As I read it, you cannot specify step and startnumber
using PEAR. But you can when you create the sequence in mysql with a create
sequence statement.
If I would use this, I guess I would have to remove the auto_increment
specification on the primary key.
So I have a workable solution, but still would like to know if there isn't
an alternative to get hold of the number of a primary key after an insert
using PEAR.
thanx,
Pugi!
Navigation:
[Reply to this message]
|