mysql problem
#10

Quote:
Originally Posted by Loot
Посмотреть сообщение
That's very odd, make sure that the table names above exist, and double check the SQL logs, there must be an error message..
I tried double check each and there was nothing wrong no warning or error.

There is something wrong with this line

Код:
	mysql_format(gSQL, Query, "SELECT `Score`, `PlayerName` FROM `"#MYSQL_TABLE"` ORDER BY `Score` ASC LIMIT 10");
    mysql_function_query(gSQL, Query, true, "LoadPlayer", "d", playerid);
    mysql_store_result();
    
    print("2");
	if (mysql_num_rows() < 1) return 0;
But wheereee

Edit:

Whole code for top:

Код:
COMMAND:top(playerid, params[])
{
	new
	    count = 10,
	    result[2][32],
	    string[(24 + 10) * 10],
	    Query[128];

    print("1");
    
	mysql_format(gSQL, Query, "SELECT `Score`, `PlayerName` FROM `"#MYSQL_TABLE"` ORDER BY `Score` ASC LIMIT 10");
    mysql_function_query(gSQL, Query, true, "LoadPlayer", "d", playerid);
    mysql_store_result();
    
    print("2");
	if (mysql_num_rows() < 1) return 0;
	
	print("3");
	while (mysql_retrieve_row() && count > 0)
	{
    	mysql_fetch_field_row(result[0], "Score");
    	mysql_fetch_field_row(result[1], "PlayerName");
    	print("4");
    	format(string, sizeof(string), "%s%d. %s: %d\n", string, count--, result[1], strval(result[0]));
	}
 	mysql_free_result();
	ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Top 10", string, "Close", "");
	print("5");
	return 1;
}
OMG What I have done! Hmm. there is something wrong?

Quote:

[19:27:35] >> mysql_connect(127.0.0.1, root, account, ******) on port 3306
[19:27:35] CMySQLHandler::CMySQLHandler() - constructor called.
[19:27:35] CMySQLHandler::CMySQLHandler() - Connecting to "127.0.0.1" | DB: "account" | Username: "root"
[19:27:35] CMySQLHandler::Connect() - Connection was successful.
[19:27:35] CMySQLHandler::Connect() - Auto-Reconnect has been enabled.
[19:27:35] >> mysql_ping( Connection handle: 1 )
[19:27:35] CMySQLHandler::Ping() - Connection is still alive.
[19:27:55] >> mysql_ping( Connection handle: 1 )
[19:27:55] CMySQLHandler::Ping() - Connection is still alive.
[19:27:55] >> mysql_query_callback( Connection handle: 1 )
[19:27:55] Passing query SELECT * FROM `account` WHERE `PlayerName` = 'test' | siii
[19:27:55] ProcessQueryThread(OnQueryFinish) - Query was successful. (SELECT * FROM `account` WHERE `PlayerName` = 'test')
[19:27:55] CMySQLHandler::ProcessQueryThread() - Data is getting passed to ->ProcessTick()
[19:27:55] OnQueryFinish(siii) - Threaded function called.
[19:27:55] >> mysql_store_result( Connection handle: 1 )
[19:27:55] CMySQLHandler::StoreResult() - Result was stored.
[19:27:55] >> mysql_num_rows( Connection handle: 1 )
[19:27:55] CMySQLHandler::NumRows() - Returned 1 row(s)
[19:27:55] >> mysql_ping( Connection handle: 1 )
[19:27:55] CMySQLHandler::Ping() - Connection is still alive.
[19:27:55] >> mysql_query_callback( Connection handle: 1 )
[19:27:55] >> mysql_free_result( Connection handle: 1 )
[19:27:55] CMySQLHandler::FreeResult() - Result was successfully free'd.
[19:27:55] Passing query SELECT `Status` FROM `account` WHERE `PlayerName` = 'test' AND `Status` = 2 | siii
[19:27:55] ProcessQueryThread(OnQueryFinish) - Query was successful. (SELECT `Status` FROM `account` WHERE `PlayerName` = 'test' AND `Status` = 2)
[19:27:55] CMySQLHandler::ProcessQueryThread() - Data is getting passed to ->ProcessTick()
[19:27:55] OnQueryFinish(siii) - Threaded function called.
[19:27:55] >> mysql_store_result( Connection handle: 1 )
[19:27:55] CMySQLHandler::StoreResult() - Result was stored.
[19:27:55] >> mysql_num_rows( Connection handle: 1 )
[19:27:55] CMySQLHandler::NumRows() - Returned 0 row(s)
[19:27:55] >> mysql_ping( Connection handle: 1 )
[19:27:55] CMySQLHandler::Ping() - Connection is still alive.
[19:27:55] >> mysql_query_callback( Connection handle: 1 )
[19:27:55] >> mysql_free_result( Connection handle: 1 )
[19:27:55] CMySQLHandler::FreeResult() - Result was successfully free'd.
[19:27:55] Passing query SELECT `LastIP` FROM `account` WHERE `PlayerName` = 'test' AND `LastIP` = '127.0.0.1' | siii
[19:27:55] ProcessQueryThread(OnQueryFinish) - Query was successful. (SELECT `LastIP` FROM `account` WHERE `PlayerName` = 'test' AND `LastIP` = '127.0.0.1')
[19:27:55] CMySQLHandler::ProcessQueryThread() - Data is getting passed to ->ProcessTick()
[19:27:55] OnQueryFinish(siii) - Threaded function called.
[19:27:55] >> mysql_store_result( Connection handle: 1 )
[19:27:55] CMySQLHandler::StoreResult() - Result was stored.
[19:27:55] >> mysql_num_rows( Connection handle: 1 )
[19:27:55] CMySQLHandler::NumRows() - Returned 1 row(s)
[19:27:55] >> mysql_ping( Connection handle: 1 )
[19:27:55] CMySQLHandler::Ping() - Connection is still alive.
[19:27:55] >> mysql_query_callback( Connection handle: 1 )
[19:27:55] >> mysql_ping( Connection handle: 1 )
[19:27:55] CMySQLHandler::Ping() - Connection is still alive.
[19:27:55] >> mysql_query_callback( Connection handle: 1 )
[19:27:55] >> mysql_free_result( Connection handle: 1 )
[19:27:55] CMySQLHandler::FreeResult() - Result was successfully free'd.
[19:27:55] Passing query SELECT `XPos`,`YPos`,`ZPos`,`AdminLevel`,`VIPLevel`,`Want edLevel`,`Kills`,`Deaths`,`Money`,`Score`,`Health` ,`Armour`,`Hours`,`Minutes`,`Seconds`,`KickCount`, `LastSkin`,`SpawnCount`,`ReportCount`,`Warnings`,` FailLogin`,`RconAttempt`,`RegDate` FROM `account` WHERE `PlayerName` = 'test' | siii
[19:27:55] ProcessQueryThread(OnQueryFinish) - Query was successful. (SELECT `XPos`,`YPos`,`ZPos`,`AdminLevel`,`VIPLevel`,`Want edLevel`,`Kills`,`Deaths`,`Money`,`Score`,`Health` ,`Armour`,`Hours`,`Minutes`,`Seconds`,`KickCount`, `LastSkin`,`SpawnCount`,`ReportCount`,`Warnings`,` FailLogin`,`RconAttempt`,`RegDate` FROM `account` WHERE `PlayerName` = 'test')
[19:27:55] CMySQLHandler::ProcessQueryThread() - Data is getting passed to ->ProcessTick()
[19:27:55] OnQueryFinish(siii) - Threaded function called.
[19:27:55] >> mysql_store_result( Connection handle: 1 )
[19:27:55] CMySQLHandler::StoreResult() - Result was stored.
[19:27:55] >> mysql_num_rows( Connection handle: 1 )
[19:27:55] CMySQLHandler::NumRows() - Returned 1 row(s)
[19:27:55] >> mysql_fetch_row_format( Connection handle: 1 )
[19:27:55] CMySQLHandler::FetchRow() - Return: -2571.57|328.51|10.56|6|0|0|0|9|69800|0|100|0|1|49| 1|0|108|52|0|0|0|1|11/11/2013
[19:27:55] >> mysql_free_result( Connection handle: 1 )
[19:27:55] CMySQLHandler::FreeResult() - Result was successfully free'd.
[19:27:55] Passing query UPDATE `account` SET `LastIP` = '127.0.0.1', `Status` = 1 WHERE `PlayerName` = 'test' | siii
[19:27:55] ProcessQueryThread(OnQueryFinish) - Query was successful. (UPDATE `account` SET `LastIP` = '127.0.0.1', `Status` = 1 WHERE `PlayerName` = 'test')
[19:27:55] CMySQLHandler::ProcessQueryThread() - Data is getting passed to ->ProcessTick()
[19:27:55] OnQueryFinish(siii) - Threaded function called.
[19:28:08] >> mysql_format( Connection handle: 1 )
[19:28:08] >> mysql_query_callback( Connection handle: 1 )
[19:28:08] >> mysql_store_result( Connection handle: 1 )
[19:28:08] CMySQLHandler::StoreResult() - No data to store.
[19:28:08] Passing query SELECT `Score`, `PlayerName` FROM `account` ORDER BY `Score` ASC LIMIT 10 | d
[19:28:08] ProcessQueryThread(LoadPlayer) - Query was successful. (SELECT `Score`, `PlayerName` FROM `account` ORDER BY `Score` ASC LIMIT 10)
[19:28:08] ProcessQueryThread(LoadPlayer) - Data caching enabled.
[19:28:08] CMySQLHandler::StoreResult() - Result was stored.
[19:28:08] CMySQLHandler::FreeResult() - Result was successfully free'd.
[19:28:08] CMySQLHandler::ProcessQueryThread() - Data is getting passed to ->ProcessTick()
[19:28:08] >> mysql_num_rows( Connection handle: 1 )
[19:28:08] CMySQLHandler::NumRows() - You cannot call this function now. (Reason: Dead Connection)
[19:28:09] >> mysql_ping( Connection handle: 1 )
[19:28:09] CMySQLHandler::Ping() - Connection is still alive.
[19:28:09] >> mysql_query_callback( Connection handle: 1 )
[19:28:09] >> mysql_ping( Connection handle: 1 )
[19:28:09] CMySQLHandler::Ping() - Connection is still alive.
[19:28:09] >> mysql_query_callback( Connection handle: 1 )
[19:28:09] Passing query UPDATE `account` SET `XPos` = -2571.57, `YPos` = 328.51, `ZPos` = 10.56, `AdminLevel` = 6, `VIPLevel` = 0, `WantedLevel` = 0, `Kills` = 0, `Deaths` = 9, `Money` = 69800, `Score` = 0, `Health` = 100.00, `Armour` = 0.00, `Hours` = 1, `Minutes` = 49, `Seconds` = 15, `LastSkin` = 108, `KickCount` = 0, `SpawnCount` = 53, `ReportCount` = 0, `Warnings` = 0, `FailLogin` = 0, `RconAttempt` = 1 WHERE `PlayerName` = 'test' | siii
[19:28:09] ProcessQueryThread(OnQueryFinish) - Query was successful. (UPDATE `account` SET `XPos` = -2571.57, `YPos` = 328.51, `ZPos` = 10.56, `AdminLevel` = 6, `VIPLevel` = 0, `WantedLevel` = 0, `Kills` = 0, `Deaths` = 9, `Money` = 69800, `Score` = 0, `Health` = 100.00, `Armour` = 0.00, `Hours` = 1, `Minutes` = 49, `Seconds` = 15, `LastSkin` = 108, `KickCount` = 0, `SpawnCount` = 53, `ReportCount` = 0, `Warnings` = 0, `FailLogin` = 0, `RconAttempt` = 1 WHERE `PlayerName` = 'test')
[19:28:09] CMySQLHandler::ProcessQueryThread() - Data is getting passed to ->ProcessTick()
[19:28:09] OnQueryFinish(siii) - Threaded function called.
[19:28:09] Passing query UPDATE `account` SET `LastSkin` = 108, `Status` = 0 WHERE `PlayerName` = 'test' | siii
[19:28:09] ProcessQueryThread(OnQueryFinish) - Query was successful. (UPDATE `account` SET `LastSkin` = 108, `Status` = 0 WHERE `PlayerName` = 'test')
[19:28:09] CMySQLHandler::ProcessQueryThread() - Data is getting passed to ->ProcessTick()
[19:28:09] OnQueryFinish(siii) - Threaded function called.

Reply


Messages In This Thread
mysql problem - by kbalor - 12.11.2013, 12:29
Re: mysql problem - by Loot - 12.11.2013, 12:36
Re: mysql problem - by kbalor - 12.11.2013, 12:38
Re: mysql problem - by Loot - 12.11.2013, 13:11
Re: mysql problem - by kbalor - 12.11.2013, 13:31
Re: mysql problem - by Loot - 12.11.2013, 13:39
Re: mysql problem - by kbalor - 12.11.2013, 13:47
Re: mysql problem - by Loot - 12.11.2013, 13:55
Re: mysql problem - by -Prodigy- - 12.11.2013, 14:22
Re: mysql problem - by kbalor - 12.11.2013, 14:25

Forum Jump:


Users browsing this thread: 1 Guest(s)