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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T09:08:43+00:00 2026-05-18T09:08:43+00:00

I have a typical table, e.g. id(int) name(varchar) address(varchar) date(datetime) I also have a

  • 0

I have a typical table, e.g.

id(int) name(varchar) address(varchar) date(datetime)

I also have a table that references validation functions for each one, e.g.

id(int) function(varchar) fail_message(varchar)
   1    email             Please enter a valid email address
   2    required          This field can not be left blank

I’d like to be able to associate each column from the first table with one or more of these validators.

The only way I can think of doing this is to stuff the ids into the column names e.g. (column name: email;1;2) and keep track of it through PHP, but that seems very messy.

Is there a good way to do this with relational databases? Would a NoSQL implementation suit this problem better?

  • 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-18T09:08:44+00:00Added an answer on May 18, 2026 at 9:08 am

    Similar to what Dan said, a relatively easy way to implement an association in sql would be to do the following:

    id(int) function_id(int) col_name(varchar)
    1       1                address
    2       1                second_address
    3       2                address
    4       2                name
    

    And then when you want to do the failure check, use the above table to link the error message to the column name (e.g. ‘select function_id from above_table where col_name=”address”‘) and then query the failure table. These tables could subsequently be combined using a view with a join so that a single query would suffice.

    Hope this helps.

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

Sidebar

Related Questions

I have a self-referencing table with an Id, CategoryName, and ParentId. It's a typical
I have a win form UI that looks like a typical calculator. Naturally I
I have two tables, A and B and a simple table, X, that maintains
I have a typical Persons table and an Orders table defined in such a
I have a typical situation. my table has four column. (id, user, col2, status)
I have a script that appends some rows to a table. One of the
My problem is this; I have to order a table of data. Each row
I have a typical self-referencing table of employees. How can you build an UDF
I am implementing a class that resembles a typical database table: has named columns
i have in the database typical tables like user, usergroup, and they have relations.

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.