How do I choose a prefix over a generic "similar" result?
So, let's say I have the following columns to be selected when I use them %un%
as search LIKE
:
fun
unlikely
mundane
But what I want is that the first prefix results are displayed first - so basically they will be returned in the following order:
unlikely
fun
mundan
Is there an easy way to do this in MySQL, or will I just have to change the array of results after I get them in PHP?
I was going to do this on the PHP side, although I'm not sure if there is a MySQL way to do this.
+3
source to share