04.02.2010, 18:19
Quote:
Originally Posted by Wicko
I really love the whole queue idea. Great job, G-Stylezz. Again.
Besides that: Код:
[14:22:20] CMySQLHandler::Connect() - Connection was successful. [14:22:20] >> mysql_query( Connection handle: 1 ) [14:22:20] CMySQLHandler::Query(select * from hrp_door) - Successfully executed. [14:22:20] >> mysql_query( Connection handle: 1 ) [14:22:20] CMySQLHandler::Query(select * from hrp_gz) - An error has occured. (Error ID: 2014, Commands out of sync; you can't run this command now) [14:22:20] >> mysql_query( Connection handle: 1 ) [14:22:20] CMySQLHandler::Query(select * from hrp_anim) - An error has occured. (Error ID: 2014, Commands out of sync; you can't run this command now) [14:22:20] >> mysql_query( Connection handle: 1 ) |
Quote:
Originally Posted by mysql.com
If you get Commands out of sync; you can't run this command now in your client code, you are calling client functions in the wrong order.
This can happen, for example, if you are using mysql_use_result() and try to execute a new query before you have called mysql_free_result(). It can also happen if you try to execute two queries that return data without calling mysql_use_result() or mysql_store_result() in between. |
Quote:
Originally Posted by Wicko
You do such a little, confusing thing in here:
Код:
cell AMX_NATIVE_CALL NativeFunctions::n_mysql_query( AMX* amx, cell* params ) { unsigned int cID = params[3]-1; MySQL_Log(">> mysql_query( Connection handle: %d )",cID+1); VALID_CONNECTION_HANDLE("mysql_query",cID); CMySQLHandler *cHandle = SQLHandle[cID]; cHandle->Query(AMX_H->GetString(amx,params[1]),params[2]); return 0; } I think you could simply return 0/1 with non-threaded queries, and -1 in threaded ones. The code would be backward compatible then. |
Quote:
Originally Posted by Wicko
It is made on purpose, or it's rather an omission, like:
Quote:
Regards! |
Quote:
Originally Posted by Wicko
EDIT:
Another catch. Код:
cell AMX_NATIVE_CALL NativeFunctions::n_mysql_fetch_field( AMX* amx, cell* params ) { /*MySQL.field = (MYm_stField *)malloc(100); MySQL.field = mysql_fetch_field_direct(MySQL.res, params[1]); AmxStringHandler->SetString(amx,params[2],std::string(MySQL.field->name)); MySQL_Log("mysql_fetch_field(Number: %d); Return: \"%s\"",params[1],MySQL.field->name); free(MySQL.field);*/ return 1; } |