Some errors
#1

Код HTML:
[21:13:52] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[21:13:56] [ERROR] mysql_escape_string - destination size is too small (must be at least as big as source)
I use in ONPLAYERLOGIN some fields like:


Код HTML:
cache_get_field_content(0, "playerStatus", result); PlayerInfo[extraid][Status] = strval(result);
to get a value from database.

Is it a problem?
Reply
#2

The size of "result" is too small to store the data. Why would you even need a temporary string and strval when there is cache_get_field_content_int function that does exactly the same thing (internal)?
Reply
#3

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
The size of "result" is too small to store the data. Why would you even need a temporary string and strval when there is cache_get_field_content_int function that does exactly the same thing (internal)?
What do you wanna say? Give me an example please.
Reply
#4

He meant, the cell size of your result array is too small. For example, lets say you created it like; result[20] but the data name contains more than 20 characters.

And, with cache_get_field_content_int, you can directly fetch the integer value without having to use strval. Right now, you are fetching the data as a string and converting them into an integer value.
Reply
#5

Quote:
Originally Posted by Sjn
Посмотреть сообщение
He meant, the cell size of your result array is too small. For example, lets say you created it like; result[20] but the data name contains more than 20 characters.

And, with cache_get_field_content_int, you can directly fetch the integer value without having to use strval. Right now, you are fetching the data as a string and converting them into an integer value.
I asked him for an example. I understood that i have to fetch directly the integer.. i want to see how.
Reply
#6

Код:
PlayerInfo[extraid][Status] = cache_get_field_content_int(0, "playerStatus");
Reply
#7

Quote:
Originally Posted by Sjn
Посмотреть сообщение
Код:
PlayerInfo[extraid][Status] = cache_get_field_content_int(0, "playerStatus");
Ok thanks. But for floats or chars how do i have to make it?
Reply
#8

bump?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)