SA-MP Forums Archive
print is empty - 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: print is empty (/showthread.php?tid=659054)



print is empty - Nelixus - 21.09.2018

Hey i have an issue trying to print variable from Mysql DataBase when i do this:
Код:
cache_get_value(0, "isidarbino", pInfo[playerid][workingSince]);
	printf("%s", pInfo[playerid][workingSince]);
i get print statmen empty any idea why and in DataBase i have
?


Re: print is empty - KinderClans - 21.09.2018

What's the utility to print a variable from the database when it's stored already in your pInfo enum?

I guess "workingSince" is stored as column in your players table in database, so why retrieving it with a query? Just remove the cache_get_value part and print from pInfo enum.

pawn Код:
printf("%s", pInfo[playerid][workingSince]);



Re: print is empty - Nelixus - 21.09.2018

Quote:
Originally Posted by KinderClans
Посмотреть сообщение
What's the utility to print a variable from the database when it's stored already in your pInfo enum?

I guess "workingSince" is stored as column in your players table in database, so why retrieving it with a query? Just remove the cache_get_value part and print from pInfo enum.

pawn Код:
printf("%s", pInfo[playerid][workingSince]);
Its stored in row:

but then if i remove
Код:
cache_get_value(0, "isidarbino", pInfo[playerid][workingSince]);
part it doesnt load from DB, any other ideas?


Re: print is empty - Nelixus - 21.09.2018

Код:
[09/21/18 16:49:19] [DEBUG] cache_get_value_name(0, "isidarbino", 0xF4E1FBC4, 1)
[09/21/18 16:49:19] [DEBUG] cache_get_value_name: assigned value: '2018-08-09'
[09/21/18 16:49:19] [DEBUG] cache_get_value_name: return value: '1'
this is mysql Debug log


Re: print is empty - kingmk - 21.09.2018

Try use cache_get_value_name.

cache_get_value_name(0, "isidarbino", pInfo[playerid][workingSince], 31);


Re: print is empty - Nelixus - 21.09.2018

it doesnt write to the string


Re: print is empty - Nelixus - 21.09.2018

the string is allways empty


Re: print is empty - Nelixus - 21.09.2018

Quote:
Originally Posted by kingmk
Посмотреть сообщение
Try use cache_get_value_name.

cache_get_value_name(0, "isidarbino", pInfo[playerid][workingSince], 31);
nevermind your sullution works thans +rep dood