NYCPHP Meetup

NYPHP.org

[nycphp-talk] PHP/MySQL environment problem??

Daniel Convissor danielc at analysisandsolutions.com
Mon Mar 3 18:44:53 EST 2008


On Mon, Mar 03, 2008 at 01:59:31PM -0500, csnyder wrote:

> If for some reason your table can't include an AUTO INCREMENT field,
> perhaps you could just "SELECT id FROM table ORDER BY id DESC LIMIT 1"
> to get the highest id number, and then add one to it.

And if you need to go that route, read up on MySQL's "FOR UPDATE" syntax.

--Dan

-- 
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
            data intensive web and database programming
                http://www.AnalysisAndSolutions.com/
 4015 7th Ave #4, Brooklyn NY 11232  v: 718-854-0335 f: 718-854-0409



More information about the talk mailing list