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

  • SEARCH
  • Home
  • 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 7065323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:56:32+00:00 2026-05-28T04:56:32+00:00

OK so I am creating a system where whenever a shop signs up, they

  • 0

OK so I am creating a system where whenever a shop signs up, they get 10 default slides that they can then customize later. The default slide data is just a starting point for them. But I have to assume a lot of shops will not log in and update the information, they just want something up ASAP.

So say for the Dashboard slide, every shop starts out with the same heading and text until they go in and update it themselves. Do I insert it in the database, like so:

id | slide_id | user_id | headline | text
1  | 1        | 1000    | ...      | ....
2  | 1        | 1001    | ...      | ....

So the database will contain many duplicates of that headline and text since it is the default. Is that a good idea?

Or do I do something like this:

define("DEFAULT_TEXT", "The text goes here and just used once in a file.");
$text = ($stmt->num_rows < 1 ? DEFAULT_TEXT : $text);

so I have a query that searches through my slide_data table to see if anything exists for that slide id, and if it does, then just use that headline and text.. but if there are no rows, which means they have not added anything yet, then just use the constant DEFAULT_TEXT. And that way, I can have different language config files and have translations in there, so if the language is French then it will use the DEFAULT_TEXT_FR constant which will have the manual translation.


Which one do you recommend? I’m not sure if I have the right idea here, so looking for some other opinions and suggestions.

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-28T04:56:33+00:00Added an answer on May 28, 2026 at 4:56 am

    I would define the default text outside of the database, storing it in the db creates unecessary duplicate entries which will ultimately effect performance over time (the larger a db table gets the longer it takes to query that table). Once you have it defined just run a query by user id to see if they created text for that slide, otherwise default to your predefined text

    Edit:

    $result = mysql_query(your check to see if slide exists);
    while ($row= mysql_fetch_assoc($result)) {
        $displayText = $row['text'];
    };
    
    if ($displayText != '') {
        $sql = 'update command';
    } else {
        $displayText = DEFAULT_TEXT;
        $sql = 'insert command';
    }
    
    mysql_query($sql);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a system with a JavaScript client that will communicate with the server
I am creating a system that will store objects in an SQLite Database. I
I'm interested in creating a system where the user can define the steps in
So, I'm creating a system which manages all the drupal websites that sit within
I'm creating a log system ('outside' the application) that logs all the click on
I'm creating a little app that configures a connected device and then saves the
I'm creating a system that turns a small script into a dll. I'm encountering
I'm creating a system in VB.net that utilizes Lua via the LuaInterface. To associate
I'm creating a system that allow me to create users automatically after an inscription.
I am on creating a system, I am trying to ensure that user cannot

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.