Hi friends
i have a while loop running in my coding which is fatching some data from the database. there are duplicacy of some names in the records means there are some common names share by many users. now i need to form a array of each name which is more than one times in my records. note i want each name means if the name "David" coming three times in my records than the name "David" should be three times in the array.
Thanks if anybody can help me for this.
how to get the duplicate data's array from the coming data
Moderator: General Moderators
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
Re: how to get the duplicate data's array from the coming data
Code: Select all
SELECT name, COUNT(name) AS number FROM sometable GROUP BY name ORDER BY number DESCWait... you're doing DB selects in a WHILE loop? Why?