i ment that you are doing to many operations:
- counting length of the main string
- replacing the substring with nothing in the main string
- counting length of the resulted main string
- the difference of the 2 main strings per length of the substring => nr of occurences
looks complicated to me
if this is the only option available then i'll use this
i hope mysql will pop a new substr_count function in the coming versions
