MySQL loading bug?
#7

If you're storing the string into an array, it won't load it properly. The reason for this is because the "sizeof" operator will get the size of the array, and not the string you're trying to store it in. So, for example, if the size of your array is 3, then it'll load 3 characters and nothing more.

Doing this:

pawn Код:
enum enumPlayerInfo
{
   pID,
   pPassword[129]
};

new
   pStats[MAX_PLAYERS][enumPlayerInfo];

cache_get_row(row, field, pStats[playerid][pPassword]);
Is not the same as doing this:

pawn Код:
new
   szPassword[129];
cache_get_row(row, field, szPassword);
In the first example, it will only load two characters of the user's password because the array is the size of the enum (i.e. 2). In the second example, though, it'll figure out that the size of the string "szPassword" is 129 and it can load the entire password.

A workaround is to either add a large string size at the end of your cache_get_X(..) lines, or to modify the a_mysql.inc file. I would choose the first option, though. The second might screw things up.
Reply


Messages In This Thread
MySQL loading bug? - by arakuta - 07.08.2013, 23:12
Re: MySQL loading bug? - by Macluawn - 08.08.2013, 00:24
Re: MySQL loading bug? - by arakuta - 08.08.2013, 03:05
Re: MySQL loading bug? - by arakuta - 08.08.2013, 15:01
Re: MySQL loading bug? - by Misiur - 08.08.2013, 15:39
Re: MySQL loading bug? - by arakuta - 08.08.2013, 15:43
Re: MySQL loading bug? - by Scenario - 08.08.2013, 15:55
Re: MySQL loading bug? - by arakuta - 08.08.2013, 22:04

Forum Jump:


Users browsing this thread: 1 Guest(s)