problem with mysql plugin blueg
#1

Hi, I have a problem I downloaded namely SC -RP script with the https://sampforum.blast.hk/showthread.php?tid=538107 topic. I have a problem that would like to update the mysql plugin to the latest version but I have problems when compiling since the old features are not used in the latest MySQL and do not know how to change them. If the syntax is poor sorry, I do not come from an English-speaking country.

Errors:
Код:
C:\Users\Grzechu\Desktop\SC-RP\roleplay.pwn(1679) : error 017: undefined symbol "mysql_ping"
C:\Users\Grzechu\Desktop\SC-RP\roleplay.pwn(1958) : error 017: undefined symbol "mysql_affected_rows"
C:\Users\Grzechu\Desktop\SC-RP\roleplay.pwn(1978) : error 017: undefined symbol "mysql_insert_id"
Reply
#2

mysql_ping isn't use at all anymore as it automatically detects whether you're connected or not, just remove that line completely.
mysql_affected_rows isn't used anymore either. You can use thread queries and a loop with (rows).
and mysql_insert_id is now replaced with cache_insert_id (ctrl+r, replace it).
Reply
#3

Код:
SQL_Connect() {
	g_iHandle = mysql_connect(SQL_HOSTNAME, SQL_USERNAME, SQL_DATABASE, SQL_PASSWORD);

	if (mysql_ping(g_iHandle) < 1) {
	    printf("[SQL] Connection to \"%s\" failed! Please check the connection settings...\a", SQL_HOSTNAME);
	}
	else {
		printf("[SQL] Connection to \"%s\" passed!", SQL_HOSTNAME);
	}
}
Код:
SQL_Connect();
	ManualVehicleEngineAndLights();
	new rcon[80];
	format(rcon, sizeof(rcon), "hostname %s", SERVER_NAME);
	SendRconCommand(rcon);
	format(rcon, sizeof(rcon), "weburl %s", SERVER_URL);
	SendRconCommand(rcon);
	format(rcon, sizeof(rcon), "map %s", SERVER_MAP);
	SendRconCommand(rcon);
	SetGameModeText(SERVER_REVISION);

	if (mysql_ping(g_iHandle) < 1)
	    return 0;

	Server_Load();
    mysql_function_query(g_iHandle, "SELECT * FROM `billboards`", true, "Billboard_Load", "");
	mysql_function_query(g_iHandle, "SELECT * FROM `houses`", true, "House_Load", "");
    mysql_function_query(g_iHandle, "SELECT * FROM `businesses`", true, "Business_Load", "");
    mysql_function_query(g_iHandle, "SELECT * FROM `dropped`", true, "Dropped_Load", "");
    mysql_function_query(g_iHandle, "SELECT * FROM `entrances`", true, "Entrance_Load", "");
	mysql_function_query(g_iHandle, "SELECT * FROM `cars`", true, "Car_Load", "");
	mysql_function_query(g_iHandle, "SELECT * FROM `jobs`", true, "Job_Load", "");
	mysql_function_query(g_iHandle, "SELECT * FROM `crates`", true, "Crate_Load", "");
	mysql_function_query(g_iHandle, "SELECT * FROM `plants`", true, "Plant_Load", "");
	mysql_function_query(g_iHandle, "SELECT * FROM `factions`", true, "Faction_Load", "");
	mysql_function_query(g_iHandle, "SELECT * FROM `arrestpoints`", true, "Arrest_Load", "");
    mysql_function_query(g_iHandle, "SELECT * FROM `gates`", true, "Gate_Load", "");
    mysql_function_query(g_iHandle, "SELECT * FROM `backpacks`", true, "Backpack_Load", "");
    mysql_function_query(g_iHandle, "SELECT * FROM `impoundlots`", true, "Impound_Load", "");
    mysql_function_query(g_iHandle, "SELECT * FROM `atm`", true, "ATM_Load", "");
    mysql_function_query(g_iHandle, "SELECT * FROM `garbage`", true, "Garbage_Load", "");
    mysql_function_query(g_iHandle, "SELECT * FROM `vendors`", true, "Vendor_Load", "");
    mysql_function_query(g_iHandle, "SELECT * FROM `gunracks`", true, "Rack_Load", "");
    mysql_function_query(g_iHandle, "SELECT * FROM `speedcameras`", true, "Speed_Load", "");
    mysql_function_query(g_iHandle, "SELECT * FROM `graffiti`", true, "Graffiti_Load", "");
    mysql_function_query(g_iHandle, "SELECT * FROM `detectors`", true, "Detector_Load", "");
How is it removed?
Код:
if(mysql_affected_rows(g_iHandle)) {
		format(string, sizeof(string), "You have successfully jailed %s's account.", name);
		SendClientMessageEx(index, COLOR_WHITE, string);

	}
Код:
public OnQueryExecute(playerid, query[])
{
	static
	    rows,
	    fields;

	cache_get_data(rows, fields, g_iHandle);

	if (strfind(query, "SELECT", true) != -1)
		Dialog_Show(playerid, ExecuteQuery, DIALOG_STYLE_INPUT, "Execute Query", "Success: MySQL returned %d rows from your query.\n\nPlease specify the MySQL query to execute below:", "Execute", "Back", rows);

	else
		Dialog_Show(playerid, ExecuteQuery, DIALOG_STYLE_INPUT, "Execute Query", "Success: Query executed successfully (affected rows: %d).\n\nPlease specify the MySQL query to execute below:", "Execute", "Back", mysql_affected_rows());

	PlayerData[playerid][pExecute] = 0;
	return 1;
}
How to change it?
Reply
#4

help!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)