sql - MySQL: is checking for new records by values of auto_increment column bad? -


I am creating a web application that includes notification functionality - the user can get one or more information (messages) System or other users at any time.

When new (unread) messages occur, they will be displayed to the user in the popup window. The message will be reduced (most of the time a sentence each, and only a few at a time), so they will appear completely and all at once.

The user will then have the "Disapproval" button which will mark these messages as "Read."

My question comes about implementing this "dismiss" button. One approach will be to remember the ID of the messages and mark each person individually. However, a query will be required for each message.

A better way would be to remember the smallest ID and the largest ID, and then issue a where the update ID will be issued between XXX and YYY . But is it safe? Can I be certain that the new row IDs included in the table will be larger than these IDs? Is there no foreign situation that can outwit this approach? (Clustering? Load balancing? Replication? Something else?)

Maybe this base is off, but why not Remember all message IDs with ID id in

  Issue the update query with > 

Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -