SA-MP Forums Archive
Convert easymysql to MYSQL - 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: Convert easymysql to MYSQL (/showthread.php?tid=649185)



Convert easymysql to MYSQL - NotThatWeird - 04.02.2018

Title, does anyone have any idea how to convert easymysql to MYSQL?


Re: Convert easymysql to MYSQL - PepsiCola23 - 04.02.2018

why would you do that?

https://sampforum.blast.hk/showthread.php?tid=590310


Re: Convert easymysql to MYSQL - NotThatWeird - 04.02.2018

Quote:
Originally Posted by PepsiCola23
Посмотреть сообщение
Well there are too many functions with mysql i don't know the functions of easymysql so.


Re: Convert easymysql to MYSQL - Mobtiesgangsa - 04.02.2018

here is my example on gamemodeinit

Код:
public OnGameModeInit()
{
	mysql_log(ERROR | WARNING | INFO | DEBUG);

	option_Id = mysql_init_options();
	mysql_set_option(option_Id, AUTO_RECONNECT, true);
	
	g_Handle = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DATABASE, option_Id);
	
	if(g_Handle == MYSQL_INVALID_HANDLE || mysql_errno(g_Handle) != 0)
	{
	    print(MYSQL_FAILURE);
	    SendRconCommand("exit");
	}
	else
	{
	    print(MYSQL_SUCCESS);
	}
	
	new Query[1024];
	mysql_format(g_Handle, Query, sizeof(Query), "CREATE TABLE IF NOT EXISTS `Accounts` (\
		`ID` int(11) NOT NULL AUTO_INCREMENT, \
		`Name` varchar(24) NOT NULL, \
		`Password` varchar(129) NOT NULL, \
		`Ip` varchar(18) NOT NULL, \
		`Level` int(11) NOT NULL, \
		`Money` int(11) NOT NULL, \
		`Kills` int(11) NOT NULL, \
		`Deaths` int(11) NOT NULL, \
		`Scuicides` int(11) NOT NULL, \
		`Skin` int(11) NOT NULL, \
		`Interior` int(11) NOT NULL, \
		`X` float NOT NULL, \
		`Y` float NOT NULL, \
		`Z` float NOT NULL, \
		PRIMARY KEY (`ID`))");
	mysql_tquery(g_Handle, Query);
	
	SetGameModeText(GAMEMODE_TEXT);
	return 1;
}
edit: i use R41-4

https://github.com/pBlueG/SA-MP-MySQL/releases