Mysql Query for comma separated values in table field

  • httpftp21
  • Graduate
  • Graduate
  • httpftp21
  • Posts: 101

Post 3+ Months Ago

I am storing sub usertypes in comma separated values in the table field like (1,2,3)

Now when i am doing search:
i gave user the option to select mutiple sub user types

so i hv an array:
subUserType[] = 1
subUserType[] = 2

When the User Search for sub user types i want all the users to be listed
which are having following values
user1 = (1,5)
user2 = (2,5)
user3 = (4,5)
user4 = (1,2)

so i want users 1, 2 and 3 to be listed when i do mutiple swlect for 1 and 2
  • BIOSTALL
  • Graduate
  • Graduate
  • User avatar
  • Posts: 125
  • Loc: UK

Post 3+ Months Ago

If you're doing a search for 1 and 2, wouldn't you want users 1, 2 and 4 to be returned? Not user 3?

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 54 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.