Working with MySQL and I can't find the right combination of terms for this expression.
Using a PHP user input variable in my statement, I need to find a partial substring match and group by the full match word
Taking example input "#bea" I want to find matches for "#bea" as a substring in full text posts, then group by and count the full word where it matches such as "#beat", "#beauty", "#beast"
With example posts in database
Testing Post #beat #beauty
Another test #beauty #beast
Testing #boom #beast
I want to search for a substring, example "#bea"
and have the output
Match | Count
#beast | 2
#beauty | 2
#beat | 1
Can this be done with MySQL or am I better finding matches and counting full words using a PHP algorithm?