cache_get_field_content_float - invalid datatype
#1

Hello everyone,
I started learning MySQL few days ago, and suddenly something goes wrong with some floats. It's about register / login system, that saves your position. The problem is when I try to load the last position from the DB with cache_get_field_content_float, I'm getting an error in the mysql log. (cache_get_field_content_float - invalid datatype)
But it's compiling without any errors.

Here's the code:

pawn Код:
PlayerInfo[playerid][posX] = cache_get_field_content_float(0, "posX");

I tried to find some solution, but I couldn't ... Am I doing something wrong ?

P.S. I'm using the latest BlueG's MySQL plugin (r39-2).
Reply
#2

Quote:
Originally Posted by MarTaTa
Посмотреть сообщение
Hello everyone,
I started learning MySQL few days ago, and suddenly something goes wrong with some floats. It's about register / login system, that saves your position. The problem is when I try to load the last position from the DB with cache_get_field_content_float, I'm getting an error in the mysql log. (cache_get_field_content_float - invalid datatype)
But it's compiling without any errors.

Here's the code:

pawn Код:
PlayerInfo[playerid][posX] = cache_get_field_content_float(0, "posX");

I tried to find some solution, but I couldn't ... Am I doing something wrong ?

P.S. I'm using the latest BlueG's MySQL plugin (r39-2).
According to that error you get in the mysql log, I can tell that the "posX" column type is not float, so take a look at it and change the type to float.
Reply
#3

Quote:
Originally Posted by ThePhenix
Посмотреть сообщение
According to that error you get in the mysql log, I can tell that the "posX" column type is not float, so take a look at it and change the type to float.
Nope. It is a Float... Here's the enumerator :

pawn Код:
enum pInfo
{
        // other stuff
    Float: posX,
    Float: posY,
    Float: posZ,
        // other stuff
}
new PlayerInfo[MAX_PLAYERS][pInfo];
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)