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 6049081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:32:08+00:00 2026-05-23T07:32:08+00:00

Would you rather use mySQL database to store language variables or php variables? Please

  • 0

Would you rather use mySQL database to store language variables or php variables?

Please consider

  • Performance
  • Adding
  • Editing

and how would you do it? Store it to php variables, for example

$language['en']["hello"] = "Hello";
$language['cz']["hello"] = "Ahoj";

and use function

function l($lvar)
{
    global $language, $default_language;
    return $language[$default_language][$lvar];
}

and use it like

<div id="test">
    <?php echo l("hello"); ?>
</div>

? What is better?

And what about to store them in database and every time (or once 10 minutes) create (generate) php file with variables

  • 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-23T07:32:09+00:00Added an answer on May 23, 2026 at 7:32 am

    It depends on some things:

    1. Do you want persistence (e.g. do you want the variables to be stored once, and then retrieved)?

      If you want peristence then you should go with MySQL (or some XML/YAML file), to store up your data, so that even if you edit your code in someway or migrate to another language it is not lost.

    2. Do you want easy editing?
      If you save your data in a php file, external editing can be hard as you either have to rewrite that file or you have to someway save the newer changes. It is easier to change something store in an SQL-table than in a code file.

    In the end I personally would prefer an external storage for easier migration, and simpler editing.

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

Sidebar

Related Questions

For a mysql database, is it better to use (for performance etc...) letters or
When starting out with a new application, would you rather just use an existing
I have a webapp written in PHP using a MySQL database backend. This question
(please excuse that I didn't use aliases). I would like my query output to
I have an IList<T> that I need to sort, and I would rather not
I'm using the asp:TreeView and would really rather just output it to a standard
Why would you do an automatic HTML post rather than a simple redirect? Is
I would like to create my ObjectDataProvider in my C# code behind rather than
I'm quite new to subject of writting stored function for mySQL database, hence i'm
Does anyone have a PHP function that for example if a mysql_error() happens due

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.