SA-MP Forums Archive
server closes mysql - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Server (https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: server closes mysql (/showthread.php?tid=431786)



server closes mysql - grebbekevin - 19.04.2013

Dear sa-mp users,

I was buzy making a server, i was trying to make it with mysql but when i run the server he closes it, i have tried to look what is wrong but he stops just before he executes the mysql_query.
Here the OnPlayerConnect script
Код:
public OnPlayerConnect(playerid)
{

        new query[256];

	format(query, sizeof(query), "SELECT * FROM 'gebruikers' WHERE 'gebruikersnaam' = 'Kevin_Elias'");

	mysql_query(query);
	mysql_store_result();

	if(mysql_num_rows() == 1)
	{
	    print("Send client message gebruikersnaam is al in gebruik");
	    SendClientMessage(playerid, -1, "Deze gebruikersnaam is al in gebruik!");
		print("show player dialog 0");
	    ShowPlayerDialog(playerid, 0, DIALOG_STYLE_INPUT, "Login", "Log hier in", "login", "cancel");

	}
	else
	{
	    print("SendClientMessage je mag deze gebruikersnaam registreren");
	    SendClientMessage(playerid, -1, "Je mag deze gebruikersnaam registreren");
	    print("ShowPlayerDialog 1");
	    ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Registreer", "Registreer hier", "Registreer", "cancel");

 	}
	return 1;
}
I hope someone can help me with this problem


Re: server closes mysql - Sithis - 20.04.2013

You're formatting the query wrongly. You have to use ` ` instead of ' '