View Single Post

  #7 (permalink)  
Old 10-23-2005
J.O. Aho
 
Posts: n/a
Default Re: Glitch in php or count() in mysql?

Tony Marston wrote:

> You should be using 'select max(msg_id) from messagesdb;' instead of 'select
> count(*) from messagesdb'. In this way it will not matter if any previous
> entries get deleted.


This can still generate doublets of msgid as the select statment can be
trigged by two different people trying to add something,
AUTO_INCREMENT UNIQUE should in most cases be used for ID (numerial) columns.


//Aho
Reply With Quote