SA-MP Forums Archive
Mysql cache_get_field_content undefined symbol - 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: Mysql cache_get_field_content undefined symbol (/showthread.php?tid=599018)



Mysql cache_get_field_content undefined symbol - Aa12 - 19.01.2016

Код:
cache_get_field_content(i, "Owner");
error 017: undefined symbol "Owner"

cache_get_field_content parameters :
(row, const field_name[], destination[], connectionHandle = 1, max_len = sizeof(destination))

WTF


Re: Mysql cache_get_field_content undefined symbol - AmigaBlizzard - 19.01.2016

Can you show some more code?
A few lines above this one and a few below it as well?


Re: Mysql cache_get_field_content undefined symbol - Aa12 - 19.01.2016

Quote:
Originally Posted by AmigaBlizzard
Посмотреть сообщение
Can you show some more code?
A few lines above this one and a few below it as well?
Код:
for(new i; i<47; i++)
{
HouseInfo[houseid][ID] = cache_get_field_content_int(i, "HouseID");
HouseInfo[houseid][hEnterX] = cache_get_field_content_float(i, "EnterX");
HouseInfo[houseid][hEnterY] = cache_get_field_content_float(i, "EnterY");
HouseInfo[houseid][hEnterZ] = cache_get_field_content_float(i, "EnterZ");
HouseInfo[houseid][hExitX] = cache_get_field_content_float(i, "ExitX");
HouseInfo[houseid][hExitY] = cache_get_field_content_float(i, "ExitY");
HouseInfo[houseid][hExitZ] = cache_get_field_content_float(i, "ExitZ");
HouseInfo[houseid][hInsideInt] = cache_get_field_content_int(i, "InsideInt");
HouseInfo[houseid][hInsideVir] = cache_get_field_content_int(i, "InsideVir");
HouseInfo[houseid][hOutsideInt] = cache_get_field_content_int(i, "OutsideInt");
HouseInfo[houseid][hOutsideVir] = cache_get_field_content_int(i, "OutsideVir");
HouseInfo[houseid][hOwned] = cache_get_field_content_int(i, "Owned");
HouseInfo[houseid][hLocked] = cache_get_field_content_int(i, "Hlocked");
HouseInfo[houseid][hInventory] = cache_get_field_content_int(i, "HouseInventory");
HouseInfo[houseid][hSecurity] = cache_get_field_content_int(i, "HouseSecurity");
HouseInfo[houseid][hPrice] = cache_get_field_content_int(i, "Price");
HouseInfo[houseid][hType] = cache_get_field_content_int(i, "HouseType");
HouseInfo[houseid][hQuality] = cache_get_field_content_int(i, "HouseQuality");
cache_get_field_content(i, "Owner", HouseInfo[houseid][Owner]);
}



Re: Mysql cache_get_field_content undefined symbol - Aa12 - 20.01.2016

bump


Re: Mysql cache_get_field_content undefined symbol - Prokill911 - 20.01.2016

Код:
 HouseInfo[houseid][Owner] = cache_get_field_content(i, "Owner");
Or

Код:
 
new HouseOwner[1024];
cache_get_field_content(i, "Owner", HouseOwner);
HouseInfo[houseid][Owner] = HouseOwner;



Re: Mysql cache_get_field_content undefined symbol - Aa12 - 22.01.2016

Quote:
Originally Posted by Prokill911
Посмотреть сообщение
Код:
 HouseInfo[houseid][Owner] = cache_get_field_content(i, "Owner");
Or

Код:
 
new HouseOwner[1024];
cache_get_field_content(i, "Owner", HouseOwner);
HouseInfo[houseid][Owner] = HouseOwner;
I still get

error 017: undefined symbol "Owner"


Re: Mysql cache_get_field_content undefined symbol - Sawalha - 22.01.2016

it's impossible to get an undefined symbol error of something between brackets and defined as a string, for me it seems that the error is from the houseinfo array, check its enum and make sure that you have defined "Owner" variable in that enum as a string, be cause you are using cache_get_field_content function which the strings get retrieved from the db by, so make sure it's:
Код:
Owner[MAX_PLAYER_NAME],
in the houseinfo enum.
plus, remember that strings variables' value gets edited by formatting it, '=' operator isn't the way to do that.


Re: Mysql cache_get_field_content undefined symbol - Aa12 - 22.01.2016

Quote:
Originally Posted by Sawalha
Посмотреть сообщение
it's impossible to get an undefined symbol error of something between brackets and defined as a string, for me it seems that the error is from the houseinfo array, check its enum and make sure that you have defined "Owner" variable in that enum as a string, be cause you are using cache_get_field_content function which the strings get retrieved from the db by, so make sure it's:
Код:
Owner[MAX_PLAYER_NAME],
in the houseinfo enum.
plus, remember that variables' value gets edited by formatting it, '=' operator isn't the way to do that.
You were right, thanks.

Problem was here HouseInfo[houseid][Owner] I forgot that I named it in enum as "hOwner"


Re: Mysql cache_get_field_content undefined symbol - Jack_SMalls - 22.01.2016

For a more complete use of MySQL, you can use the allotted functions used for specific value types. Example..



FactionID is just a numerical value where FactionName is a string. (also, I use the optional parameters.. it is not required or necessary)

I guess this response is more directed towards ProKill.