Reply to [PEAR] How to get the value of an auto_increment primary key after an insert ?

Your name:

Reply:


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!

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация