Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 263581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T22:36:49+00:00 2026-05-11T22:36:49+00:00

When you want to alert a user of something once (one time notes about

  • 0

When you want to alert a user of something once (one time notes about new features, upcoming events, special offers, etc.), what’s the best way to do it?

I’m mainly concerned with the data representation, but if there are more issues to think about please point them out. This is my first time approaching this particular problem.

So my thoughts so far …

You could have a users, a messages, and a seen/acknowledged messages table. When the user acknowledges the messages, we have a new entry in the seen table with a user id & message id pair.

However, the seen table will grow rapidly with the number of users and messages. At some point, this would become unwieldy (any insight when that would be for a single mysql db on a single server?).

Would it be better to just create 1 seen table per message and maybe end up with 20-30 such additional tables to start? Not really a problem. It just comes with the added nuisance of having to create a new table every time there is a new message (of course, that would be automated in the code – still a little more coding).

This is for a project that has 2-3K current users, but the hopes are to grow that to 10K over the next year, and of course, we’re looking beyond that, too …

Edit:
I’m not enthusiastic about the currently top voted method at all.
The proposal seems to be to prepopulate a messages table and delete messages as they are seen. This seems to be a lot more work. You not only have to add your entire user list each time you add a new message. You also have to add all the messages for a new user each time you add a new user – separate logic.

On top of that, the record of a message being “seen” is actually the absence of a record. That does not seem right. Plus, if you later decide to track when messages were seen with a simple time stamp. You’ve have to rewrite a lot of code and other code becomes unusable.

Lastly, could someone tell me why it’s so absolutely horrible to add new tables to the database? Doesn’t this happen all the time when a new feature is added? Take any CMS: Joomla or WordPress for example. When you add new plugins, you are creating tables dynamically. So it has to be more nuanced and contextual than “don’t do it”. What are the pitfalls and what are the circumstances under which you don’t do it or it’s okay to do?

I can see that you might say: Be careful about creating new tables on a production servers. Make sure it’s been well tested, but ultimately, you’re just adding an empty table.

This may require and extended answer, so if any knows any articles, please post them.

Edit: Gabriel Sosa gave a nice flushed out example of his messages table, and I’ll simply create a seen table similar to what I originally posted although with timestamp column too. Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T22:36:49+00:00Added an answer on May 11, 2026 at 10:36 pm

    this was my aproach:

    CREATE TABLE IF NOT EXISTS `system_user_messages` (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      `user_id` int(11) NOT NULL,
      `section` enum('home','account','all') NOT NULL DEFAULT 'home',
      `message` varchar(250) NOT NULL,
      `message_type` varchar(25) NOT NULL,
      `show` tinyint(4) NOT NULL DEFAULT '1',
      `allow_dismiss` tinyint(4) NOT NULL DEFAULT '1',
      `created_on` datetime NOT NULL,
      `dismissed_on` datetime DEFAULT NULL,
      `show_order` int(11) NOT NULL DEFAULT '0',
      PRIMARY KEY (`id`),
      KEY `idx-user_id` (`user_id`),
      KEY `idx-section` (`section`),
      KEY `message_type` (`message_type`)
    );
    

    I added allow_dismiss because you may dont want allow the user to dismiss that message. In my case when some user’s CC is about to expire we dont allow to dismiss and then the system remove the message once the user updates the CC information. By the other hand you may also want to show the message only on certain areas of your site.

    I posted the sql because I think is clear in this way… I know there are lot improments to make over this schema but maybe give you an idea.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We alert user using this javascript, now i want to add this functionality to
I'm studying Javascript cookie. Basically what I want is when the first time user
<script> $(function(){ $('.logger').bind('click',function(){ alert('we will log that the user shared something'); return true; //keep
<script language=JavaScript> function chkname (){ var ip = document.getElementsById(user); if(ip==){ alert(please input something!); return
I am presenting user with a alert dialog which contains 2 items, I want
I have a JavaScript function code where I want to alert. function msgalert(x,y) {
I have a JavaScript function code where I want to alert. function msg(x,y) {
When someone double clicks on the entire row, I want an alert. How do
Mobile browsers. Jquery dialog alert box. I don't want to use alert() because it
I want to set an alert service for my website users for there tasks.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.