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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T17:36:27+00:00 2026-06-05T17:36:27+00:00

I am building a custom field feature for my application. This allows the administrator

  • 0

I am building a custom field feature for my application. This allows the administrator to add custom profile fields for users to fill in depending on the site’s needs.

The schema is simple

field_meta (store some metadata about the field)
================================================
id
type //type of field
field_name //name of the field in the fields table
render_data //Some data to use when rendering the form field

field
===================
id
name //Default field that can't be deleted
address //Default field that can't be deleted
customfield_1
customfield_2

The field_meta table is used to store some meta data for the field, so that we can render the form fields.

Each field is then stored in a new column in the field table.

Problem:
For usability and to not have to deal with users choosing reserved words or using non-english words for the column name, I will not be asking users to choose a name for the column name.

I am currently considering calling the column name by field type (there are quite a few types in the application (email, website, text, paragraphtext, etc), just to name a few) and adding a number. Some examples:

  • Email_1
  • Text_1
  • Text_2
  • Text_3
  • Email_2
  • etc

However, the problem with this approach is that it takes a fair bit of work to come up with the column name. I need to get all the columns, pick out the ones with the same column type as I am creating, parse for the largest number, and then create the column.

Is there a better strategy to do this? Or perhaps a totally different way to name the columns that eliminates these problems?

  • 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-06-05T17:36:29+00:00Added an answer on June 5, 2026 at 5:36 pm

    I decided to go with my original approach, that is to basically create a column name consisting of the type and an incremented number:

    • Email_1
    • Text_1
    • Text_2
    • Text_3

    While it takes a fair bit of effort to generate the name, this is only done when creating the profile fields, so the performance hit would only occur during that time.

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

Sidebar

Related Questions

I'm building my first site with drupal. And I made a custom user field:
The Scenario I am building a custom CMS for a communications application. The users
I'm building a site and need to allow users to be able to create
I am building a custom button and I have this so far: {!REQUIRESCRIPT(/soap/ajax/8.0/connection.js)} var
I have a custom control for building forms to automatically generate a label-input field
I am building an application with a custom interface for entering text, and was
I am building an application that makes heavy use of Enum s for custom
We're planning to create a web application where users can build custom forms, choosing
In my ASP.NET MVC 2 web application, I allow users to create custom input
I'm building a review site that will allow users to submit reviews which will

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.