I’m not sure how much info you want/need to retrieving info from a database. http://www.php.net/
is a great source to figure out how to do this. If you want more details, just write back and we’ll help out. What you might want to do is read in the urls from the database into an array. Once you have this array of urls, you can use the following php functions on the array:
Array_count_values( $array ) this function will count the values in the array, thus giving you a count of each url in the array.
Array_unique( $array ) this function will return an array with the duplicate urls removed. You can then use this new array to display them back to the user, or do whatever it is that you are doing with the urls.
Further descriptions of the functions can be found on http://www.php.net/
This should point you in the right direction. There may be a way to do the same thing w/ SQL, but the above is how I would go about it, depending what you want to do with the dataset once it has been returned.