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

  • Home
  • SEARCH
  • 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 3350082
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:44:38+00:00 2026-05-18T01:44:38+00:00

I have a MySQL table with clients in it, the usual data, names, addresses,

  • 0

I have a MySQL table with clients in it, the usual data, names, addresses, phone numbers etc etc i also have a field which is called ‘roles’ in which a client ticks off what they like to do i.e coding, graphic design, illustrations etc etc .. this data gets pushed into the field serialized with each roles code, the following is an example.

a:3:{s:4:"_wfa";s:2:"on";s:3:"_CS";s:2:"on";s:3:"_CM";s:2:"on";}

On a ‘viewall’ page, i need to output all the details for a user that has ticked a specific box, as an example, i need to output all users that have ticked the ‘_wfa’ box.

I hope this makes sense, i cant seem to figure out how to do it.

I hope someone can shed some light on this.

Cheers,

  • 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-18T01:44:38+00:00Added an answer on May 18, 2026 at 1:44 am

    You should never have more than one value in a single column of a row. Store the roles in their own database table, with the user’s ID, and you will be able to simply ask MySQL for the users with a role as desired.

    CREATE TABLE user_roles (user_id INT, role_name VARCHAR(100));
    INSERT INTO user_roles (1, '_wfa');
    INSERT INTO user_roles (1, '_CS');
    INSERT INTO user_roles (1, '_CM');
    
    SELECT users.id FROM users INNER JOIN user_roles ON users.id = user_roles.user_id WHERE user_roles.role_name = '_wfa';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a mySQL table called clients with this structure: Name | Phone |
I have a MySQL table containing domain names: +----+---------------+ | id | domain |
I have a mysql legacy table which contains an client identifier and a list
I have a MySQL table that looks like this: my_number my_unique_text_field in which, my_number
I have table with the following data in table clients ------------------ |id|client|status| ------------------ |1
I have a Sqlite 3 and/or MySQL table named clients.. Using python 2.6, How
I have mysql table that has a column that stores xml as a string.
I have a MySQL table with approximately 3000 rows per user. One of the
I have a MySQL table LOGIN_LOG with fields ID, PLAYER, TIMESTAMP and ACTION. ACTION
I have a mysql table that relies on the unix epoch time stamp equivalent

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.