SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 08/11/2019, 12:24 PM   #1
LasVegas
Little Clucker
 
Join Date: Oct 2012
Posts: 35
Reputation: 0
Default undefined symbol "cache_get_data"

I want to get this command to work on higher mysql version script, but when compiling this code

Code:
forward Onlastlogin_Response(playerid, playername[]);
public Onlastlogin_Response(playerid, playername[])
{
	new rows, data, LastLogin[64], string[256];
	cache_get_data(rows, data, MainPipeline);

	if(rows) { // account exists
		    cache_get_field_content(0, "LastLogin", LastLogin, MainPipeline);

		    format(string, sizeof(string), "Showing last login date information for %s", playername);
		    SendClientMessageEx(playerid, COLOR_LIGHTRED, string);

		    format(string, sizeof(string), "Last login date: %s", LastLogin);
			SendClientMessageEx(playerid, COLOR_WHITE, string);
			return 1;
		}
		else return SendClientMessageEx(playerid, COLOR_GREY, "That specific account does not exist.");
}

forward Onregisterdate_Response(playerid, playername[]);
public Onregisterdate_Response(playerid, playername[])
{
	new rows, data, RegiDate[64], string[256];
	cache_get_data(rows, data, MainPipeline);

	if(rows) { // account exists
		    cache_get_field_content(0, "RegiDate", RegiDate, MainPipeline);

		    format(string, sizeof(string), "Showing registered date information of %s", playername);
		    SendClientMessageEx(playerid, COLOR_LIGHTRED, string);

		    format(string, sizeof(string), "Registered date: %s", RegiDate);
			SendClientMessageEx(playerid, COLOR_WHITE, string);
			return 1;
		}
		else return SendClientMessageEx(playerid, COLOR_GREY, "That specific account does not exist.");
}
the error
Code:
./includes/admin/admin.pwn(211) : error 017: undefined symbol "cache_get_data"
./includes/admin/admin.pwn(214) : error 017: undefined symbol "cache_get_field_content"
./includes/admin/admin.pwn(247) : error 017: undefined symbol "cache_get_data"
./includes/admin/admin.pwn(250) : error 017: undefined symbol "cache_get_field_content"
Pawn compiler 3.10.6	 	 	Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
LasVegas is offline   Reply With Quote
Old 08/11/2019, 12:28 PM   #2
Mugala
High-roller
 
Mugala's Avatar
 
Join Date: Nov 2012
Location: Georgia, Tbilisi
Posts: 1,177
Reputation: 73
Default Re: undefined symbol "cache_get_data"

you're using wrong MySQL function or wrong MySQL version, you decide which one is wrong.
open pawn folder > includes > a_samp.inc and check the version.
__________________
Coding in 8 languages including Pawn, C#, C++ and SQL.
Available for hiring.

If you have a coding question or need an assistance in a code, just PM me.
If you want me to create something for you, here is a Discord Mugala#5651

Currently helping Community members in a coding.
Mugala is offline   Reply With Quote
Old 08/11/2019, 12:34 PM   #3
LasVegas
Little Clucker
 
Join Date: Oct 2012
Posts: 35
Reputation: 0
Default Re: undefined symbol "cache_get_data"

Quote:
Originally Posted by Mugala View Post
you're using wrong MySQL function or wrong MySQL version, you decide which one is wrong.
open pawn folder > includes > a_samp.inc and check the version.
I guess I'm using an R41-3 version. Can you assist me with updating this code?
LasVegas is offline   Reply With Quote
Old 08/11/2019, 12:42 PM   #4
Mugala
High-roller
 
Mugala's Avatar
 
Join Date: Nov 2012
Location: Georgia, Tbilisi
Posts: 1,177
Reputation: 73
Default Re: undefined symbol "cache_get_data"

yes, R41 and R40 using same functions and parameters.
https://wiki.sa-mp.com/wiki/MySQL/R40 <-- this is a direct link for wiki, to see some functions.

so, yeah, I'll assist you.
change cache_get_field_content to cache_get_value_name (strings)
and cache_get_data with cache_get_value_name_int and cache_get_value_name_float, depends what you're trying to get.
__________________
Coding in 8 languages including Pawn, C#, C++ and SQL.
Available for hiring.

If you have a coding question or need an assistance in a code, just PM me.
If you want me to create something for you, here is a Discord Mugala#5651

Currently helping Community members in a coding.
Mugala is offline   Reply With Quote
Old 08/11/2019, 03:40 PM   #5
LasVegas
Little Clucker
 
Join Date: Oct 2012
Posts: 35
Reputation: 0
Default Re: undefined symbol "cache_get_data"

Quote:
Originally Posted by Mugala View Post
yes, R41 and R40 using same functions and parameters.
https://wiki.sa-mp.com/wiki/MySQL/R40 <-- this is a direct link for wiki, to see some functions.

so, yeah, I'll assist you.
change cache_get_field_content to cache_get_value_name (strings)
and cache_get_data with cache_get_value_name_int and cache_get_value_name_float, depends what you're trying to get.
Could you give me an example?
LasVegas is offline   Reply With Quote
Old 08/11/2019, 04:17 PM   #6
Kwarde
High-roller
 
Kwarde's Avatar
 
Join Date: Nov 2009
Location: The Netherlands
Posts: 2,711
Reputation: 1668
Default Re: undefined symbol "cache_get_data"

Actually, cache_get_data() became cache_get_row_count() and cache_get_field_count().
cache_get_field_content() became cache_get_value_name()

@OP: Lookup the wiki page for the correct usage of these functions.


And yes I'm sure. I recently updated sfcnr to the latest MySQL version so it's very fresh in my mind.
__________________
When the opportunity presents itself to flip-a da table, uh, you flip-a da table.

Discord: Kwarde#1966
Kwarde is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem: undefined symbol "handle_mysql", "strcpy" CoachCarter Scripting Help 5 31/08/2016 12:27 PM
"error 017: undefined symbol "vehicleid"" problem. OMonger Scripting Help 5 31/01/2015 12:55 PM
error 017: undefined symbol "ReadPlayer" and error 017: undefined symbol "WritePlayer" brandypol Scripting Help 8 26/08/2014 06:16 PM
5 Dialog errors - Input line too long, undefined symbol "t","is" and "only" Deal-or-die Scripting Help 6 01/05/2012 12:08 PM


All times are GMT. The time now is 02:35 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.