I have this kind of data in my database "mydb" :
id | name
---------
1 | abcdef
2 | bcdefg
3 | cdefgh
4 | defghi
5 | efghij
I do a simple SELECT query like this one :
SELECT * FROM mydb WHERE name LIKE '%defgh%'
So i get those results :
id | name
---------
3 | cdefgh
4 | defghi
I would like to know if there is a way, with mysql, to inject html code which encompasses the string searched with "LIKE" statement directly in the result ?
So the results would be :
id | name | html
----------------
3 | cdefgh | c<mark>defgh</mark>
4 | defghi | <mark>defgh</mark>i