Possible Duplicate:
Find duplicate strings in database
im querying a mysql database with php.
I need to know what names are repeated over 375 in the table (it has 375 rows). The table contains 3 columns: id, name, category.
Here is my php code, however it counts with php, and i want it to be made with mysql
$query = "SELECT * FROM user_likes";
//echo $query;
$result = mysql_query($query) or die(mysql_error());
// craete arrays
while($row = mysql_fetch_array($result)){
set_time_limit(0);
$like[$row['name']]=$like[$row['name']]+1;
if($like[$row['name']]==375) $likes375 ++;
}
If someone could help me ill appreciate it. Thanks!