Dead Connection MySQL
#1

I'm having a problem with MySQL, I'm trying to check if the player has an account with this:

Код:
if (RegistrationStep[playerid] == 0 && gPlayerLogged[playerid] != 1)
	{
		new query[128];
        format(query, sizeof(query), "SELECT Level FROM players WHERE username = '%s'", playerName(playerid));
		if (mysql_num_rows() == 0)
		{
			gPlayerAccount[playerid] = 0;
 			new regstring[128];
			new regname[64];
			GetPlayerName(playerid,regname,sizeof(regname));
			format(regstring,sizeof(regstring),"{FFFFFF}• Bun venit, "#COL_RED2"%s\n• {FFFFFF}Nu ai cont.\n• Te rog sa te inregistrezi:",regname);
			ShowPlayerDialog(playerid,12345,DIALOG_STYLE_PASSWORD,"Register",regstring,"Register","Exit");
		}
		else
		{
			new loginstring[128];
			new loginname[64];
			GetPlayerName(playerid,loginname,sizeof(loginname));
			format(loginstring,sizeof(loginstring),"{FFFFFF}• Bine ai venit, "#COL_RED2"%s\n• {FFFFFF}Acest nume este inregistrat.\n• Poti sa te loghezi:",loginname);
			ShowPlayerDialog(playerid,12346,DIALOG_STYLE_PASSWORD,"Login",loginstring,"Login","Exit");
		}
	}
And I get this:

Код:
CMySQLHandler::NumRows() - You cannot call this function now. (Reason: Dead Connection)
Reply
#2

So, where do you actually send your query?
Reply
#3

You got me bro, I'm retarded.

I didn't noticed. Thanks!
Reply


Forum Jump:


Users browsing this thread: