I'm trying to get a PHP-script to show all duplicate values in a MySQL-table. Using the following code I get the wanted results in the phpMyAdmin SQL-query window but it won't work as a PHP mysql_query().
SELECT nordby_log.artikel, a.the_count
FROM
nordby_log,
(SELECT artikel, COUNT(*) AS the_count
FROM nordby_log
GROUP BY artikel) AS a
WHERE nordby_log.artikel = a.artikel
Any help is greatly appreciated.