I have a little question, and since I've been trying hundreds (almost... or slight exaggeration) of queries, I decided to give in, since MySQL is not my strong point - I know SELECT * and some basic JOIN - that's it.
I have a theme system on my website - each theme is saved in the database and the primary key is an INT; each users theme is set to 0 by default which is the sites theme - whenever that is changed, their theme is changed. However, if they set it (currently 1-8), then that's it, unless they choose to opt back for the site theme.
I want to be able to select the most popular theme; I tried a query
SELECT DISTINCT ( user_theme ) AS uTheme FROM users ORDER BY uTheme DESC
SELECT COUNT( DISTINCT(user_theme) ), DISTINCT ( user_theme ) AS uTheme FROM users ORDER BY uTheme DESC
It's fair to say that neither of those queries worked. I hope that by those, that someone will get my jist and be able to help me.
Thanks in advanced, any help appreciated.
This post has been edited by huzi8t9: 02 April 2013 - 03:28 PM