SQL error
#1

pawn Код:
mysql_format(mysql, query, sizeof(query), "SELECT `user`, `hours`, `minutes` FROM `players` WHERE `banned`=0 ORDER BY `hours` DESC LIMIT 10");
Above shown is a code to display the top 10 online members but it is showing until 9 rows, the 10th one says this in the server

Quote:

NULL with 0 hours and 0 minutes

here is the mysql log shows from 9th row (9th row is fine, just to show how it works until 9) but the problem starts with 10 as you could see below.



Quote:

[00:45:56] [DEBUG] cache_get_field_content - row: 9, field_name: "user", connection: 1, max_len: 24
[00:45:56] [DEBUG] CMySQLResult::GetRowDataByName - row: '9', field: "user", data: "Jason
"
[00:45:56] [DEBUG] cache_get_field_content_int - row: 9, field_name: "hours", connection: 1
[00:45:56] [DEBUG] CMySQLResult::GetRowDataByName - row: '9', field: "hours", data: "707"

[00:45:56] [DEBUG] cache_get_field_content_int - row: 9, field_name: "minutes", connection: 1
[00:45:56] [DEBUG] CMySQLResult::GetRowDataByName - row: '9', field: "minutes", data: "20"

//----------------------ERROR starts from here on

[00:45:56] [DEBUG] cache_get_field_content - row: 10, field_name: "user", connection: 1, max_len: 24
[00:45:56] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('10')
[00:45:56] [DEBUG] cache_get_field_content_int - row: 10, field_name: "hours", connection: 1
[00:45:56] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('10')
[00:45:56] [ERROR] cache_get_field_content_int - invalid datatype
[00:45:56] [DEBUG] cache_get_field_content_int - row: 10, field_name: "minutes", connection: 1
[00:45:56] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('10')
[00:45:56] [ERROR] cache_get_field_content_int - invalid datatype

Reply


Messages In This Thread
SQL error - by Bondage - 21.01.2015, 19:08
Re: SQL error - by PowerPC603 - 21.01.2015, 19:11
Re: SQL error - by Bondage - 21.01.2015, 19:20
Re: SQL error - by PowerPC603 - 21.01.2015, 21:23
Re: SQL error - by Bondage - 21.01.2015, 23:55

Forum Jump:


Users browsing this thread: 1 Guest(s)