dennismonsewicz Posted September 12, 2008 Share Posted September 12, 2008 Is there anyway to count the number of times a particular name shows up in a sql string and manipulate that particular name? IE: if I have a string like this: dog, cat, horse, dog, fish, donkey, cow, dog, bull And then I wanted to count the number of times dog shows up... any ideas? Quote Link to comment Share on other sites More sharing options...
Caesar Posted September 12, 2008 Share Posted September 12, 2008 preg_match_all() Quote Link to comment Share on other sites More sharing options...
DarkWater Posted September 12, 2008 Share Posted September 12, 2008 Why is there a CSV in a MySQL column? There should never, ever, ever, ever, never ever never be a CSV in a column. Ever. Read up on database normalization. If you had a normalized database, this would be quite a simple query. Quote Link to comment Share on other sites More sharing options...
dennismonsewicz Posted September 12, 2008 Author Share Posted September 12, 2008 alright, I shall take a look at it. I haven't really gotten a good jump on all of the joining that you can do in mysql but I reckon this is a good place to start Quote Link to comment Share on other sites More sharing options...
dennismonsewicz Posted September 12, 2008 Author Share Posted September 12, 2008 also why is having a CSV in a MySQL column bad? Quote Link to comment Share on other sites More sharing options...
DarkWater Posted September 12, 2008 Share Posted September 12, 2008 Because you can't do anything with the data. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.