string and mysql problem
#1

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
Reply
#2

bump after long time
Reply
#3

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 */ );
Reply
#4

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);
Reply
#5

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).
Reply
#6

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 );
Reply
#7

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)