Whats wrong with this (SQL)?
#1

Hey guys,
i have a little problem with my SQL-Script.

When a user login, the DB should read the string from the line. It was stored properly, but it will not read correctly from the DB. For example: I'm married to "QueenHard", it it is read out as "ueen Hard". I also see sometimes special characters / after the name (ingame).

Код:
mysql_fetch_field("MarriedTo",exstring);
PlayerInfo[playerid][pMarriedTo] = strmid(PlayerInfo[playerid][pMarriedTo], exstring, 0, strlen(exstring)-1, 255);
I used strickenkids mysql-plugin.

Is this the wrong reading / get method from the DB?

Anyone have a idea?

Thanks for help!

Greetz
Reply
#2

Why are you using strmid? Are you trying to extract something from the value you retrieved? If not, use sscanf. Also, are you substracting one from strlen because you think it'll include the nullifier in the string? Strlen won't do that; sizeof will.
Reply
#3

Did you check the mysql log file for any errors?
Reply
#4

Hey,

the MySQL Log is clean.

This are the two load-parts (when a user connects, that stuff will be loaded from the mysql-database).

I wan't to put the string into the PlayerInfo[playerid][pMarriedTo] var. But it dont put all in it. When i'm "MarriedTo" "Nescha_Love", it will be shown like "escha_lov" (or something like this, in the database it looks correctly, but not ingame).


Sorry for my bad english.

Hope for more help and thanks for your replies. :S
Reply
#5

pawn Код:
mysql_fetch_field("MarriedTo",PlayerInfo[playerid][pMarriedTo]);
And if you really want to copy the string:
pawn Код:
#define strcpy(%0,%1,%2)  \  // destination,source,lenght
    strcat((%0[0] = '\0', %0), %1, %2)
Reply
#6

What if:
pawn Код:
mysql_fetch_field("MarriedTo",PlayerInfo[playerid][pMarriedTo]);
?

LE: sorry wups, we posted in the same time.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)