I am working on a notification system on my website for users. I have a table for “events” that a user is notified of when they happen (friend requests, new followers, comments, etc.). Is there a way to insert a value like say 0 for unread and 1 for read in the //read column of the events table, for a particular event (upon request of the information by the user)? So that it is no longer notification worthy?
Share
Yep. Just store your column as
TINYINT(1). The MySQL literalTRUEevaluates to 1 andFALSEevaluates to 0, as expected.(This is assuming your events table stores the individual events that get assigned to users, not the general event types that can occur.)
Usage