On Friday 07 January 2005 02:29, Andrew Kreps wrote:

> This would be a great place for a stored procedure, but I don't know
> if I can recommend running MySQL 5 to you.  The most platform-safe way
> I can think of is to get a count(*) of the number of rows with today's
> date, add 1 to it, and stick that number on the end of the string
> you've created to insert into a varchar field.  It's an extra query
> per insert, but it'd do the job.

Don't forget to WRITE lock the table before counting, and only unlock after 
inserting the new id.

Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
Search the list archives before you post
New Year Resolution: Ignore top posted posts

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to