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,
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.