string and mysql problem - 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: string and mysql problem (
/showthread.php?tid=449254)
string and mysql problem -
NeroX98 - 08.07.2013
Hi guys.
I am making mysql save/load system on my gamemode... I've created the saving and the loading, and everything works except one player variable (it's string).
I have this code to load it:
pawn Код:
PlayerInfo[playerid][pAdminPW] = cache_get_row(0, 93, podatok);
and this
Код:
printf("%s", PlayerInfo[playerid][pAdminPW]);
to see what it gets...
When i check my server log:
◘est (from test)
why does this ◘ appear ?!?!?! and where is 't'
Also, on my databse it's test not ◘est... this happens only when i want to load... but i don't know why i don't have problem with the player name and passwords... they load succsessfuly
Re: string and mysql problem -
NeroX98 - 08.07.2013
bump after long time
Re: string and mysql problem -
Konstantinos - 08.07.2013
In order to load string with MySQL, you need the lenght. An example:
pawn Код:
cache_get_row( 0/* row */, 4 /* field */, User[ playerid ][ USER_IP ] /* destination */, 16 /* lenght */ );
Re: string and mysql problem -
CaveDweller - 08.07.2013
To grab a string from an SQL database, use this:
pawn Код:
new adminPW[50];
cache_get_field_content(row_number, field_name (example: "adminpw"), adminPW);
Re: string and mysql problem -
NeroX98 - 08.07.2013
Quote:
Originally Posted by _Zeus
In order to load string with MySQL, you need the lenght. An example:
pawn Код:
cache_get_row( 0/* row */, 4 /* field */, User[ playerid ][ USER_IP ] /* destination */, 16 /* lenght */ );
|
Now i get this error
Код:
[05:51:12] [ERROR] "cache_get_row" - invalid connection handle. (ID = 64).
Re: string and mysql problem -
Konstantinos - 08.07.2013
Which version of MySQL are you using? In a version appeared and we had to add the lenght in order to load it.
I forgot the connection handle before, so this becomes:
pawn Код:
cache_get_row( 0, 4, User[ playerid ][ USER_IP ], Handle, 16 );
Re: string and mysql problem -
NeroX98 - 08.07.2013
Quote:
Originally Posted by CaveDweller
To grab a string from an SQL database, use this:
pawn Код:
new adminPW[50]; cache_get_field_content(row_number, field_name (example: "adminpw"), adminPW);
|
It's same ... again i get ◘est... maybe it's a MYSQL Bug, im using the newest Mysql from BlueG R7