Hello,

James Mansfield wrote:
> 
> OK...newbie question it must be:
> I want to add an entry into a db tb (using php obviously) and when its added
> into the db its gets a sequencially numberred id....now can I retrieve this
> id numbe rin the same php coded page as what I create the entry with? If not
> what is the best way around it? Create a unique number for the entry before
> adding it into db??

That depends on the database you are using. You need to use sequences.
Some database do not have sequences but they do have auto-incremented
fields, so it is possible to emulate a sequence object with a separate
table with a single auto-incremented field to act as a sequence.

Regardless of what database you are using, you may want to try Metabase
which is a PHP database abstraction package that supports many databases
and abstracts the concept of sequences just like I described. Metabase
is free and is available from here:

http://phpclasses.upperdesign.com/browse.html/package/20

Regards,
Manuel Lemos

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to