mysql duplicate lines
#1

Hi,

Hi,

How to check is there more than 1 same row inserted? like i want to check if 'name' row there is player name is there any same name registered player. But i want just check all table and know what names, i'am not doing it in registration just, take a look into database to delete duplicate users if there are
Reply
#2

https://sampwiki.blast.hk/wiki/MySQL/R40..._get_row_count

PHP код:
new rows;
if(
cache_get_row_count(rows) > 1)
{
    
// Multiple users have been found.
    
return 1;
}
else
{
    
// Only one user has been found.
    
return 1;

Reply
#3

Put a unique key on the name column. If there are duplicates you will get an error. In that case you will need to find those first.
PHP код:
SELECT namecount(id) as cnt FROM Player GROUP BY name HAVING cnt 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)