Using strmid function
#1

Hello,
I have problem with strmid function.
Like having that enum: LicenseIssuer[MAX_PLAYER_NAME]
And.. after using strmid then it show: Martin_Sulov.
After relogging, system will load user data using that:
mysql_fetch_field_row(Field,"LicenseIssuer"); PlayerInfo[playerid][LicenseIssuer] = strmid(PlayerInfo[playerid][LicenseIssuer], Field, 0, strlen(Field), 255);
Then first character will deleted (by strmid) and show: *wierd character*artin_Sulov or just: artin_Sulov.

How fix that annoying problem?
Reply
#2

Instead of using a lot of mysql_fetch_field_row it's better to use mysql_fetch_row and sscanf.

If you're too lazy to switch, change the whole line to

pawn Код:
mysql_fetch_field_row(PlayerInfo[playerid][LicenseIssuer],"LicenseIssuer");
Reply
#3

Quote:
Originally Posted by SuperViper
Посмотреть сообщение
Instead of using a lot of mysql_fetch_field_row it's better to use mysql_fetch_row and sscanf.

If you're too lazy to switch, change the whole line to

pawn Код:
mysql_fetch_field_row(PlayerInfo[playerid][LicenseIssuer],"LicenseIssuer");
This code it helped to fix this annoying problem.

Thanks very much and i rep you for help.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)