Help with MYSQL, Avoid Dual Records?
#1

Hey Guys... Me Again xD... Im triying to learn MYSQL.... Im using G-sTyLeZzZ Plugin...
im having issues with a register command im triying to make... i have this....

Код:
CMD:register(playerid,params[])
{
	new query[256];
	if(isnull(params)) return SendClientMessage(playerid,COLOR_SERVER_WARNING,"[USAGE]: /REGISTER [PASSWORD]");
	if(strlen(params) < 6) return SendClientMessage(playerid,COLOR_SERVER_WARNING,"[ERROR]: Password should contain at least 6 Characters!");
	mysql_real_escape_string(params,params);
	format(query,sizeof(query),"INSERT INTO `%s` (Username,Password) VALUES ('%s',md5('%s'))",SQL_TABLE,PName(playerid),params);
	mysql_query(query);
	if(!IsPlayerConnected(playerid)) return AvoidSync();
	mysql_store_result();
	if(mysql_affected_rows())
	{
		SendClientMessage(playerid,COLOR_SERVER,"Congratulations, You'r account is now registered!, Please Log In!");
		PA[playerid][Registered] = true;
	}
	else
	{
	    SendClientMessage(playerid,COLOR_SERVER_WARNING,"[ERROR]: Registration Failed!");
	}
	return 1;
}
The thing is... I was wondering.... Is there a way to avoid dual registry?... So people with the same name cant register?.... I have tried to register... after restarting the GM... an it creates the Player, but it increases the ID so...
Reply


Messages In This Thread
Help with MYSQL, Avoid Dual Records? - by almighty - 04.10.2010, 22:27
Re: Help with MYSQL, Avoid Dual Records? - by [HiC]TheKiller - 04.10.2010, 22:35
Respuesta: Help with MYSQL, Avoid Dual Records? - by almighty - 04.10.2010, 22:52
Re: Respuesta: Help with MYSQL, Avoid Dual Records? - by [HiC]TheKiller - 05.10.2010, 01:41

Forum Jump:


Users browsing this thread: 2 Guest(s)