# Counting 'unique' strings?

**URL:** <https://forum.kirupa.com/t/counting-unique-strings/266979>\
**Category:** programming\
**Created:** [July 26, 2008, 7:03pm UTC](https://forum.kirupa.com/t/counting-unique-strings/266979 "2008-07-26T19:03:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Groady](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/groady/32/3750_2.png) [@Groady](https://forum.kirupa.com/u/Groady)\
**Post date:** [July 26, 2008, 7:03pm UTC](https://forum.kirupa.com/t/counting-unique-strings/266979/1 "2008-07-26T19:03:52Z")

</div>

I’m hoping one of the PHP/MySQL gurus can answer a question for me.

I want to know how to query a table and return the number of ‘unique’ strings contained within a column.

For example, say I have a column called ‘domains’ which contains the following:

[google.com](http://google.com)

> **[Yahoo](https://www.yahoo.com/)**
>
> News, email and search are just the beginning. Discover more every day. Find your yodel.

  

> **[Featured Content on Myspace](https://myspace.com/)**
>
> Featured Content on Myspace

  
[google.com](http://google.com)  
[facebook.com](http://facebook.com)  

> **[KIRUPA | become a better web developer](https://www.kirupa.com/)**
>
> With our thoughtfully clear, concise, and casual content, become a better (or more awesome) web developer really quickly!

There are 5 unique domains as [google.com](http://google.com) should be only counted once.

I’m a bit lost on how to do this. Any help would be great! Cheers.
