MYSQL R7 error
#1

Maybe a simple fix for you guys.

error 017: undefined symbol "query"

Код:
the query giving me the error.
mysql_function_query( connectionHandle, query[], bool:cache, callback[], format[], {Float,_}:... )
Reply
#2

include <mysql>
Reply
#3

You should modify the line with your arguments and "query" is supposed to be either a string directly or a formatted string.
Reply
#4

Create
New query[500];
Then format it
And then use the query format.
It work i'm damn sure
Reply
#5

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
You should modify the line with your arguments and "query" is supposed to be either a string directly or a formatted string.
Can you show me what you mean by that?

however, the query is not a string.

Quote:
Originally Posted by ShivRp
Посмотреть сообщение
Create
New query[500];
Then format it
And then use the query format.
It work i'm damn sure
i did this didn't work and no need for 500


The full code

Код:
timer LoadingScreenTimer[100](playerid) 
{
	LoadingPercentage[playerid] ++;
	format(string, sizeof(string), "%d%%~n~~w~Loading...", LoadingPercentage[playerid]);
	TextDrawSetString(RegisterLoginTD[playerid][5], string);
	if(LoadingPercentage[playerid] == 100)
	{

	    SendClientMessage(playerid, COLOR_YELLOW, "Use keys up-down and right-left and when you select action press F!");
	    format(string, sizeof(string), "Welcome %s~n~~n~Please type your password!", GetName(playerid));
		TextDrawSetString(RegisterLoginTD[playerid][0], string);
		LoadingPercentage[playerid] = 0;
	    TextDrawHideForPlayer(playerid, RegisterLoginTD[playerid][5]);
		mysql_format(1, Query, "SELECT * FROM `test_table` WHERE `Name` = '%e'", GetName(playerid));
    	mysql_function_query( connectionHandle, query[], bool:cache, callback[], format[], {Float,_}:... )
		mysql_store_result();
		SelectedCharacter[playerid] = 0;

		if(mysql_num_rows() == 1)
		{
		    SendClientMessage(playerid, COLOR_LIME, "You are registered, please type your password!");
			CPLK[playerid] = repeat CheckPlayerLoginKeys(playerid);
			TextDrawSetString(RegisterLoginTD[playerid][2], "LOGIN   DELETE");
		}
		else
		{
		    SendClientMessage(playerid, COLOR_LIME, "You are not registered, please type your new password!");
			CPRK[playerid] = repeat CheckPlayerRegisterKeys(playerid);
			TextDrawSetString(RegisterLoginTD[playerid][2], "REGISTER   DELETE");
		}
		TextDrawSetString(RegisterLoginTD[playerid][1], "~b~~h~A  ~w~B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  R  S~n~T  U  V  Z  Q  W  Y  X  0  1  2  3  4  5  6  7  8  9");
		for(new td = 0; td <= 2; td++) { TextDrawShowForPlayer(playerid, RegisterLoginTD[playerid][td]); }
		TextDrawShowForPlayer(playerid, RegisterLoginTD2[0]);
		TextDrawShowForPlayer(playerid, RegisterLoginTD2[1]);
		TextDrawShowForPlayer(playerid, RegisterLoginTD2[2]);
		stop LST[playerid];
	}
	mysql_free_result();
	return 1;
}
will give you rep is somebody fixes this because i really want it.
Reply
#6

Quote:
Originally Posted by Yves
Посмотреть сообщение
Can you show me what you mean by that?

however, the query is not a string.
Query parameter IS a string/array. I'll give a simple example so you can understand what I meant by that. It's like doing in a script:
pawn Код:
format(output[], len, const format[], {Float,_}:...);
when it's supposed you should change the arguments to whatever you want.

Also since you use R7, you should also use threaded queries. Keep in mind that using the latest version (R3 is always recommended.

Your code was a bit, so I'm not sure if you want exactly some part of code after getting whether there are rows or not.

pawn Код:
timer LoadingScreenTimer[100](playerid)
{
    format(string, sizeof(string), "%d%%~n~~w~Loading...", ++LoadingPercentage[playerid]);
    TextDrawSetString(RegisterLoginTD[playerid][5], string);
    if(LoadingPercentage[playerid] == 100)
    {
        SendClientMessage(playerid, COLOR_YELLOW, "Use keys up-down and right-left and when you select action press F!");
        format(string, sizeof(string), "Welcome %s~n~~n~Please type your password!", GetName(playerid));
        TextDrawSetString(RegisterLoginTD[playerid][0], string);
        LoadingPercentage[playerid] = 0;
        TextDrawHideForPlayer(playerid, RegisterLoginTD[playerid][5]);
        mysql_format(1, Query, "SELECT * FROM `test_table` WHERE `Name` = '%e'", GetName(playerid));
        mysql_function_query(1, Query, true, "OnPlayerDataLoad", "i", playerid);
       
        SelectedCharacter[playerid] = 0;
    }
    return 1;
}

forward OnPlayerDataLoad(playerid);
public OnPlayerDataLoad(playerid)
{
    new rows, fields;
    cache_get_data(rows, fields);
   
    if (rows)
    {
        SendClientMessage(playerid, COLOR_LIME, "You are registered, please type your password!");
        CPLK[playerid] = repeat CheckPlayerLoginKeys(playerid);
        TextDrawSetString(RegisterLoginTD[playerid][2], "LOGIN   DELETE");
    }
    else
    {
        SendClientMessage(playerid, COLOR_LIME, "You are not registered, please type your new password!");
        CPRK[playerid] = repeat CheckPlayerRegisterKeys(playerid);
        TextDrawSetString(RegisterLoginTD[playerid][2], "REGISTER   DELETE");
    }
       
    TextDrawSetString(RegisterLoginTD[playerid][1], "~b~~h~A  ~w~B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  R  S~n~T  U  V  Z  Q  W  Y  X  0  1  2  3  4  5  6  7  8  9");
    for(new td = 0; td <= 2; td++) { TextDrawShowForPlayer(playerid, RegisterLoginTD[playerid][td]); }
    TextDrawShowForPlayer(playerid, RegisterLoginTD2[0]);
    TextDrawShowForPlayer(playerid, RegisterLoginTD2[1]);
    TextDrawShowForPlayer(playerid, RegisterLoginTD2[2]);
    stop LST[playerid];
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)