Re: [PHP] database abstraction layer

[email protected] (Lester Caine)
Newsgroups php.general
Message-ID <[email protected]>
Ashley Sheridan wrote:
> On Tue, 2010-02-02 at 23:19 +0100, Rene Veerman wrote:
> 
>> function getMax($table, $field)
> 
> If I saw this sort of code I'd be appalled! It's possibly the worst way
> to get the auto increment value. You won't notice it testing the site
> out on your own, but all hell will break loose when you start getting a
> lot of hits, and two people cause an auto increment at the same time!

ADOdb handles SEQUENCE correctly across all databases. Since MySQL does not 
understand SEQUENCE or GENERATOR, ADOdb simulates it with a dummy table which 
autoincrements and gets around the problem. Then one can use a secure generic 
GetID ;)

-- 
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.