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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T02:38:53+00:00 2026-05-19T02:38:53+00:00

I am working on a web application that store a lot of measurement data.

  • 0

I am working on a web application that store a lot of measurement data.

These measures have different types like temperature, flow, weight, concentration…

I am currently trying to implement a measurement units manager to let the users of the application choose which unit they want for each measure.

The data is in multiple tables :

Table1 : weightMeasure1 lengthMeasure1 TemperatureMeasure1

Table2 : weightMeasure2 lengthMeasure2 FlowMeasure2

Table3 : flowMeasure3

The users will be able to choose the unit that they want for each measure independently. So it will not be a metric/imperial choice.

All the data will be saved in there SI or SI derived unit in the Database. Because I am using PHP for my application I decided to use Zend_Measure to handle the conversion (after asking this question).


How to define the unit of each measures in my database?

How to manage the user unit preferences?


This is the best solution that I have so far :

I will create a property table :

property : property_id name column unit

  • property_id is a unique incremented number (PK)
  • name is a human readable name (optional)
  • column is a concatenation of the table name and the column name (Unique constraint). For example : table2_lengthMeasure2
  • unit is the Zend constant string defining the unit of the property in the database. For example : SQUARE_METER, KILOGRAM_PER_HOUR, … more details available in the Zend Framework API.

I will create a user_property_unit table to manage the user preferences :

user_property_unit : user_id property_id unit

  • unit is the Zend constant string defining the unit of the property when it will be display in the UI for the user. For example it can be SQUARE_METER in the unit column of the property table and SQUARE_FOOT in the unit column of the user_property_unit

The problems that I see with this solution are:

  • Using the concat of table name + column name seems not right to me…
  • If I change the name of one of my columns it will not be reflected in the property table.

Thanks for your Help!!


UPDATE
Is there any one why can help me even with some tips?

  • 1 1 Answer
  • 1 View
  • 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-19T02:38:54+00:00Added an answer on May 19, 2026 at 2:38 am

    You want to have a separate table for PROPERTIES and a separate linking table TABLECOLUMNPROPERTY that makes a specific property the attribute of the column.

          PROPERTIES
          propid
          name
          unitid      FK references UNITS table
    
    
         TCP
         (tablename,columnname) composite PK
         propid
    
    
         UNITS
         unitid
         etc etc
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a decent working web application (Java/Servlet/Jsp) that I would like to improve
I'm working on a web application that has a lot to download (javascript, images,
I'm working on a web application that will have a custom UI for the
I have am working on a web application that makes use of helper classes.
I'm working on an iPhone application that downloads data from a web server and
I'm working on an ASP.NET web application that uses a lot of JavaScript on
I am working on a web based application that will need to store usernames
I have a class in a web application I am working on that holds
I am working on web application that will use PHP & MySQL. Application will
i m working on a web application that reads files from some where and

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.