Wednesday, 15 July 2015

php - mysql order by matches in comma separated field -



php - mysql order by matches in comma separated field -

i have 1 blog table contains different tags,

now want order blog max tag match

and storing tags comma separated in 1 field

now how that?

i tried find in set still dident work.

please suggest me improve way so.

table like:

id | title | desc | tags 1 | test1 | test1 desc | t1,t2,t3,t4 2 | test2 | test desc | t1,t2 3 | test3 | test desc | t1,t2,t3 4 | test4 | test desc | t3,t4 5 | test5 | test desc | t1,t2,t3,t4

here suppose want closest blog post of "test1" post reply should 5,3,2,4

first match tags , after if same tag count id

php mysql

No comments:

Post a Comment