SA-MP Forums Archive
Need help with mysql_query(); - 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: Need help with mysql_query(); (/showthread.php?tid=551992)



Need help with mysql_query(); - danielpalade - 22.12.2014

I am trying to use mysql_query(query);
on this code.
Код:
public OnPlayerConnect(playerid)
{
	new query[126], pName[MAX_PLAYER_NAME];
	
	GetPlayerName(playerid, pName, sizeof(pName));
	
	format(query, sizeof(query), "SELECT * FROM accounts WHERE name = '%s'", pName);
	mysql_query(query);
	mysql_store_result();
	
	if(mysql_num_rows() == 1)
	{
	    new string[256];
	    format(string, sizeof(string), "Welcome to MaxZone RPG server.\n\nPlease enter your password to login.");
	    ShowPlayerDialog(playerid, 0, DIALOG_STYLE_PASSWORD, "MaxZone - Login", string, "Login", "Cancel");
	}
	else
	{
	    new string2[256];
	    format(string2, sizeof(string2), "Welcome to MaxZone RPG server.\n\nPlease register your password.");
	    ShowPlayerDialog(playerid, 1, DIALOG_STYLE_PASSWORD, "MaxZone - Register", string2, "Register", "Cancel");
	}
	
	return 1;
}
But for some reason i get the error "error 035: argument type mismatch (argument 1)".
How can i fix this?


Re: Need help with mysql_query(); - danielpalade - 22.12.2014

Anyone?


Re: Need help with mysql_query(); - Nimrod - 22.12.2014

Try using mysql_tquery. https://sampwiki.blast.hk/wiki/MySQL/R33#mysql_tquery