php - I want to select same word from database. table -


i want select same words database

database name: username ==================================================== | id | name  | fathername | ip         | datetime  | | 1  | ali   | imran      |192.168.1.1 | 12-12-2015| | 2  | asd   | hafiz      |142.150.8.9 | 12-12-2015| | 3  | sef   | warya      |100.178.3.7 | 12-12-2015| | 4  | qasim | zaheer     |192.168.1.1 | 12-12-2015| | 5  | zulfi | zahid      |192.168.1.1 | 12-12-2015| | 6  | jamel | hasan      |192.168.1.1 | 12-12-2015| | 7  | wasif | junaid     |192.168.1.1 | 12-12-2015| ==================================================== 

when use counter (select count(*) number from...... ) result echo ( 7 ) wanna select same ip 1 ip. (id: 1,4,5,6,7) 5 same ip wanna show 5 same ip 1 ip total record-3

select count(*) `username` group `ip`; 

or

select distinct(`ip`) `username`; 

or

select count(*) `username` `ip` in (select distinct(`ip`) `username`) ; 

Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -