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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:12:59+00:00 2026-05-22T16:12:59+00:00

When I need a table to set settings for my app. I always use

  • 0

When I need a table to set settings for my app. I always use table with many fields:

create table options (

 id ...
 url ...
 keys ..
 path ...

)

Of course I need one ID (because I have one settings)

Could I use other approach like:

create table options (

 id ...
 field ..

)

When field is for example:

`key => value`

So I don’t need to set many fields ..

BS:
The fields have different types: int text datetime .. etc

  • 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-22T16:12:59+00:00Added an answer on May 22, 2026 at 4:12 pm

    Sure, you can do that. Just make sure you cast to the correct type when taking the values out of the database, and, similarly, when inserting or updating them.

    PHP example:

    // saving a settings value
    
    $max_length = 20;
    mysql_query("UPDATE settings SET value = '{$max_length}' WHERE field = 'max_length'");
    
    // obtaining a settings value
    
    $result = mysql_query("SELECT value FROM settings WHERE field = 'max_length'");
    $settings = mysql_fetch_assoc($result);
    $max_length = (int) $settings['value'];
    

    For the above example, your schema will need a field (varchar) and a value (varchar).

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

Sidebar

Related Questions

I need to do a join with a table/result-set/whatever that has the integers n
I need to get a set of distinct records for a table along with
For a given table 'foo', I need a query to generate a set of
I need table with editable cells for my Android app. Something like QTableWidget in
I need some advice on how to set column widths in a HTML table.
I need to have MySQL query like this one: UPDATE table_name SET 1 =
I need to set up jquery to cycle through tables, making sure it shows/hides
I need a table to store the state of a financial transaction. The state
I need a table that stores key-value pairs, so I created one with a
I need a table where rows are actually 2 rows tables, a nested table

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.