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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T13:52:17+00:00 2026-05-15T13:52:17+00:00

This is a bit of a difficult problem for me to word, and I

  • 0

This is a bit of a difficult problem for me to word, and I may be going about it in the completely wrong way.

I’m storing a set of options in a database, where each option is its own column. The user can change the number of options, however, so I need a way of allowing PHP to always select all the options.

Let’s say I have these columns: options_dialog_1, options_dialog_2, options_dialog_3, options_dialog_4

There could be a varying number of these dialog option columns, eg, another called options_dialog_5 could be added.

How do I select all the dialog option columns, based on their column name format?

  • 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-15T13:52:18+00:00Added an answer on May 15, 2026 at 1:52 pm

    I think you have a database design problem here; repeating columns like that always leads to trouble in the end. I think you need two tables, one for the user and one for the options defined something like this…

    USERS
       id
       name
    
    OPTIONS
        id
        user_id
        option_dialogue_number
        option_dialogue_value
    

    That turns the columns into rows, which are rather easier to get at.

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

Sidebar

Related Questions

This is a bit of a difficult problem to explain, but I'm hoping it
It is bit difficult to explain, but I'm facing problem in pagination of set
I presume this isn't a common problem, which makes it a bit more difficult
I have this problem which i find a bit difficult to explain but I
Somehow its a bit difficult to for me to build a query like this:
I am having a bit of difficulty with this current code I have set
It's a bit difficult getting my problem into a short form, so I apologise
I'm faced with a bit of a difficult problem. I store all the versions
This problem struck me as a bit odd. I'm curious how you could represent
okay, my problem is a little bit more difficult than the title would tell...

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.