Wallpapers Forums Login

How To Get The Number Of Unique Items In A Column From A Mysql Query

hi, i find your tutorials very helpful, but i have a question, i need to know how to get the number of unique items in a column from a mysql query

i have been breaking my head and finally i am giving up

what do you suggest? please reply promptly.
wallpaperama Wed Dec 08, 2010
you use the DISTINCT() in your query.

for example, lets say you have a database of your users, and you want to know which users have their name john, you can use this query like this:


$query= "SELECT DISTINCT(UserName) FROM Users ORDER BY UserName ASC";

hope that helps

Related Content

Information

Share

wallpaperama | Wallpapers | Forums | Terms Of Service

copyright © 2013 wallpaperama - All Rights Reserved - Last Updated Mon May 06, 2013 (-8 GMT)
Powered by: Webune Forums V5