mysql duplicate lines - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: mysql duplicate lines (
/showthread.php?tid=617010)
mysql duplicate lines -
MerryDeer - 14.09.2016
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
Re: mysql duplicate lines -
JordanZaundd - 14.09.2016
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;
}
Re: mysql duplicate lines -
Vince - 14.09.2016
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 name, count(id) as cnt FROM Player GROUP BY name HAVING cnt > 1