MySQL fetching data error invalid data type - NULL
#1

Hey folks!

I'm new to all this so excuse me if this is a dumb question, thanks. So I am currently trying to fix up an old gamemode just for fun, and apparently whenever I start up the server I get these errors saying I have invalid data type when using cache_get_row_int and cache_get_row_float. All these have DEFAULT NULL.

Examples:
Код:
[DEBUG] CMySQLResult::GetRowData - row: '5', field: '19', data: "NULL"
[ERROR] cache_get_row_int - invalid datatype

[DEBUG] CMySQLResult::GetRowData - row: '6', field: '12', data: "NULL"
[ERROR] cache_get_row_float - invalid datatype
Shouldn't it ignore the data when it's NULL and not retrieve the actual word NULL? I'd think it should avoid it and not give a result of NULL, because that would obviously cause a problem when it's a string and integer. I'm using BlueG's MysQL R39-5. Anyone got any suggestions?

// If any further information is needed to solve this problem, let me know.
Reply
#2

If you try to retrieve any data with cache_get_row_int and cache_get_row_float functions and its datatype is not integer and float respectively, it will display the error and that is a fine behavior if you ask me.

Default values shouldn't be set to NULL to begin with. If for whatever reason you want to keep them NULL, there's a macro "ismysqlnull" in the a_mysql.inc file. You retrieve with cache_get_row, if it is not null converting manually but that is by far worse method.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)