firstly i do not using this code for wordpress site , i want it code to put it into my own website.So now i have problem regarding that i want to display most viewed post from each of the category,
i have table => post
content || category || views
-------------------------------
text 1 | cat1 | 700
text 2 | cat2 | 900 <==== most views in cat 2
text 3 | cat2 | 900
text 4 | cat1 | 900 <==== most views in cat 1
text 5 | cat1 | 800
text 6 | cat2 | 800
text 7 | cat3 | 700 <==== most views in cat 3
text 8 | cat2 | 900
text 9 | cat3 | 100
text10 | cat1 | 100
i want output like this :
content || category || views
-------------------------------
text 4 | cat1 | 900
text 2 | cat2 | 900
text 7 | cat3 | 700