Re: Latest CVS / auto_increment...
Brought to you by:
bs_php,
nigelswinson
From: Nigel S. <nig...@us...> - 2002-01-18 18:43:52
|
> What is the most clever way to have an attribute auto incremented ? > > <item id="1"> > <itemvalue>foo</itemvalue> > </item> > > <item id="2"> > <itemvalue>foo</itemvalue> > </item> > > and so on to have the "id" attribute auto incremented ? phpxmldb does something akin to this with RecordIds. You might want to have a look at it. Essentially though you just get the last item id, and add one. Nothing more clever than that. If you build your own super class on top of Php.XPath, then you can create/override the AddRecord() methods to do the work for you. Nigel =========================== For the most recent version of Php.XPath, V2.x, and an archive of this list visit: http://www.sourceforge.net/projects/phpxpath |