I have been teaching myself PHP and mysql for a few months now and throwing together a script for doing newsletters. Now for the relevant part. I put all the data into a mysql database with multiple tables. My problem is trying to sort the results.
The table I am working with has two columns, UserID and CatID. UserID is unique and it is how I, at the moment, keep track of individual users. The issue I am having is CatID is a set with possible values of 1,2,3,4,5,6. I can not figure out how to pull out partial matches. If I want to do a search for any UserID tied with '1 or 4 or 5' that user needs to have selected exactly 1,4,5 and nothing more or less. I just want to be able to do a partial match so if they had 1,2,6 and I was searching for 1,4,5 it would see 1 is a match and pull that UserID and I am unsure how to do that..
I know this is probably clear as mud, so feel free to ask me wtf I am talking about.. Also if there is a better place to ask I will delete this post and post it elsewhere.
-edit- I will be changing from SET soon as I have the time. Thank you all who helped me out.
Subreddit
Post Details
- Posted
- 14 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/Database/co...