mysql duplicates, php loop over alphabet, cloc