Another problem with mysql - Load info
#7

Oh, my fault, sorry

Код:
stock InitConnection(playerid)
{
	new
		Query[90],
		EscName[MAX_PLAYER_NAME];

	mysql_real_escape_string(pName(playerid), EscName);

	format(Query, sizeof(Query), "SELECT * FROM `playerinfo` WHERE `Nick` = '%s'", EscName);

	mysql_query(Query);
	mysql_store_result();

	if(mysql_num_rows() != 0)
	{
	SendClientMessage(playerid, COLOUR_WHITE, "[!] Loading ur infos from DB...");
	LoadPlayerInfo(playerid);
	}
	else
	{
	SendClientMessage(playerid, COLOUR_WHITE, "[!] Creating ur table in the DB...");
	format(Query, sizeof(Query), "INSERT INTO `playerinfo` (`Nick`) VALUES ('%s')", EscName);
	mysql_query(Query);
	}
	mysql_free_result();
}
Reply


Messages In This Thread
[SOLVED] Another problem with mysql - Load info - by scuess - 11.08.2011, 17:09
Re: Another problem with mysql - Load info - by JaTochNietDan - 11.08.2011, 17:10
Re: Another problem with mysql - Load info - by scuess - 11.08.2011, 17:13
Re: Another problem with mysql - Load info - by JaTochNietDan - 11.08.2011, 17:15
Re: Another problem with mysql - Load info - by scuess - 11.08.2011, 17:18
Re: Another problem with mysql - Load info - by JaTochNietDan - 11.08.2011, 17:21
Re: Another problem with mysql - Load info - by scuess - 11.08.2011, 17:25
Re: Another problem with mysql - Load info - by JaTochNietDan - 11.08.2011, 17:29
Re: Another problem with mysql - Load info - by scuess - 11.08.2011, 17:34

Forum Jump:


Users browsing this thread: 1 Guest(s)