13.02.2014, 21:57
I'm attempting to build a Dynamic Faction System using MySQL and I'm having a problem with Loading.
My MySQL Table looks like this:
http://i.imgur.com/31ouOcm.png
Basically, what it's doing is loading the First faction, but not any others.
MySQL Log:
Server Log:
As you can see from the Picture of the Database Picture above, there are two rows in the Database.
My Stock:
My OnQueryFinish:
My MySQL Table looks like this:
http://i.imgur.com/31ouOcm.png
Basically, what it's doing is loading the First faction, but not any others.
MySQL Log:
Код:
[19:25:28] [19:25:28] ** MySQL Debugging enabled. [19:25:28] [19:25:28] >> mysql_connect(localhost, samp, samp, ***) on port 3306 [19:25:28] CMySQLHandler::Connect() - Connection was successful. [19:25:28] CMySQLHandler::Connect() - Auto-reconnect has been enabled. [19:25:28] >> mysql_connect(localhost, samp, samp, ***) on port 3306 [19:25:28] CMySQLHandler::Connect() - Connection was successful. [19:25:28] CMySQLHandler::Connect() - Auto-reconnect has been enabled. [19:25:28] >> mysql_query_callback(Connection handle: 1) [19:25:28] >> mysql_query_callback(Connection handle: 1) [19:25:28] ProcessQueryThread(OnQueryFinish) - Executing query SELECT * FROM f_m... [19:25:28] >> mysql_query_callback(Connection handle: 1) [19:25:28] ProcessQueryThread(OnQueryFinish) - Query was successful. [19:25:28] ProcessQueryThread(OnQueryFinish) - Data caching enabled. [19:25:28] CMySQLHandler::StoreResult() - Result was stored. [19:25:28] CMySQLHandler::FreeResult() - Result was successfully freed. [19:25:28] ProcessQueryThread(OnQueryFinish) - Data being passed to ProcessTick(). [19:25:28] OnQueryFinish(i) - Callback is being called... [19:25:28] >> cache_get_data(Connection handle: 1) [19:25:28] ProcessTick() - The cache has been cleared. [19:25:28] ProcessQueryThread(OnQueryFinish) - Executing query SELECT * FROM r_m... [19:25:28] ProcessQueryThread(OnQueryFinish) - Query was successful. [19:25:28] ProcessQueryThread(OnQueryFinish) - Data caching enabled. [19:25:28] CMySQLHandler::StoreResult() - Result was stored. [19:25:28] CMySQLHandler::FreeResult() - Result was successfully freed. [19:25:28] ProcessQueryThread(OnQueryFinish) - Data being passed to ProcessTick(). [19:25:28] OnQueryFinish(i) - Callback is being called... [19:25:28] >> cache_get_data(Connection handle: 1) [19:25:28] ProcessTick() - The cache has been cleared. [19:25:28] ProcessQueryThread(OnQueryFinish) - Executing query SELECT * FROM d_m... [19:25:28] ProcessQueryThread(OnQueryFinish) - Query was successful. [19:25:28] ProcessQueryThread(OnQueryFinish) - Data caching enabled. [19:25:28] CMySQLHandler::StoreResult() - Result was stored. [19:25:28] CMySQLHandler::FreeResult() - Result was successfully freed. [19:25:28] ProcessQueryThread(OnQueryFinish) - Data being passed to ProcessTick(). [19:25:28] OnQueryFinish(i) - Callback is being called... [19:25:28] >> cache_get_data(Connection handle: 1) [19:25:28] ProcessTick() - The cache has been cleared. [19:26:39] [19:26:39] ** MySQL Debugging enabled. [19:26:39] [19:26:39] >> mysql_connect(localhost, samp, samp, ***) on port 3306 [19:26:39] CMySQLHandler::Connect() - Connection was successful. [19:26:39] CMySQLHandler::Connect() - Auto-reconnect has been enabled. [19:26:39] >> mysql_connect(localhost, samp, samp, ***) on port 3306 [19:26:39] CMySQLHandler::Connect() - Connection was successful. [19:26:39] CMySQLHandler::Connect() - Auto-reconnect has been enabled. [19:26:39] >> mysql_query_callback(Connection handle: 1) [19:26:39] ProcessQueryThread(OnQueryFinish) - Executing query SELECT * FROM f_m... [19:26:39] >> mysql_query_callback(Connection handle: 1) [19:26:39] ProcessQueryThread(OnQueryFinish) - Query was successful. [19:26:39] ProcessQueryThread(OnQueryFinish) - Data caching enabled. [19:26:39] CMySQLHandler::StoreResult() - Result was stored. [19:26:39] CMySQLHandler::FreeResult() - Result was successfully freed. [19:26:39] >> mysql_query_callback(Connection handle: 1) [19:26:39] ProcessQueryThread(OnQueryFinish) - Data being passed to ProcessTick(). [19:26:39] OnQueryFinish(i) - Callback is being called... [19:26:39] >> cache_get_data(Connection handle: 1) [19:26:39] ProcessTick() - The cache has been cleared. [19:26:39] ProcessQueryThread(OnQueryFinish) - Executing query SELECT * FROM r_m... [19:26:39] ProcessQueryThread(OnQueryFinish) - Query was successful. [19:26:39] ProcessQueryThread(OnQueryFinish) - Data caching enabled. [19:26:39] CMySQLHandler::StoreResult() - Result was stored. [19:26:39] CMySQLHandler::FreeResult() - Result was successfully freed. [19:26:39] ProcessQueryThread(OnQueryFinish) - Data being passed to ProcessTick(). [19:26:39] OnQueryFinish(i) - Callback is being called... [19:26:39] >> cache_get_data(Connection handle: 1) [19:26:39] ProcessTick() - The cache has been cleared. [19:26:39] ProcessQueryThread(OnQueryFinish) - Executing query SELECT * FROM d_m... [19:26:39] ProcessQueryThread(OnQueryFinish) - Query was successful. [19:26:39] ProcessQueryThread(OnQueryFinish) - Data caching enabled. [19:26:39] CMySQLHandler::StoreResult() - Result was stored. [19:26:39] CMySQLHandler::FreeResult() - Result was successfully freed. [19:26:39] ProcessQueryThread(OnQueryFinish) - Data being passed to ProcessTick(). [19:26:39] OnQueryFinish(i) - Callback is being called... [19:26:39] >> cache_get_data(Connection handle: 1) [19:26:39] ProcessTick() - The cache has been cleared.
Код:
[19:26:39] Loading Factions... [19:26:39] Loading Faction Ranks... [19:26:39] Loading Faction Divisions... [19:26:39] Filterscript 'Factions.amx' loaded. [19:26:39] Rows Detected. [19:26:39] Rows: 2 [19:26:39] [Slot 1] Test Government Faction Loaded. [19:26:39] Rows: 2 [19:26:39] [Slot 2] Loaded. [19:26:39] Rows: 2 [19:26:39] [Slot 3] NULL Loaded.
My Stock:
Код:
stock LoadFactions(){ print("Loading Factions..."); format(Query,sizeof(Query),"SELECT * FROM f_m"); mysql_function_query(MainPipe,Query,true,"OnQueryFinish","i",THREAD_LOADFACTIONS); return 1; }
Код:
forward OnQueryFinish(resultid,extraid,ConnectionHandle); public OnQueryFinish(resultid,extraid,ConnectionHandle){ new temp[14],rows,fields; if(resultid != THREAD_NO_RESULT){ cache_get_data(rows,fields); } switch(resultid){ case THREAD_LOADFACTIONS:{ if(rows){ print("Rows Detected."); for(new i = 0; i <= rows; i++){ printf("Rows: %i",rows); TotFacs++; cache_get_field_content(i,"fid",temp); fData[TotFacs][fTitle] = strval(temp); cache_get_field_content(i,"type",temp); fData[TotFacs][fType] = strval(temp); cache_get_field_content(i,"locale",temp); fData[TotFacs][fLocale] = strval(temp); cache_get_field_content(i,"parent",temp); fData[TotFacs][fParent] = strval(temp); cache_get_field_content(i,"abbr",fData[TotFacs][fAbbr]); cache_get_field_content(i,"title",fData[TotFacs][fTitle]); cache_get_field_content(i,"disabled",temp); fData[TotFacs][fDisabled] = strval(temp); cache_get_field_content(i,"disabledReason",fData[TotFacs][fDisabledReason]); cache_get_field_content(i,"disabledAdmin",fData[TotFacs][fDisabledAdmin]); cache_get_field_content(i,"bank",temp); fData[TotFacs][fBank] = strval(temp); cache_get_field_content(i,"phone",temp); fData[TotFacs][fPhone] = strval(temp); cache_get_field_content(i,"defaultdiv",temp); fData[TotFacs][defaultdiv] = strval(temp); cache_get_field_content(i,"defauljoin",temp); fData[TotFacs][defaultjoin] = strval(temp); cache_get_field_content(i,"defaultleader",temp); fData[TotFacs][defaultleader] = strval(temp); cache_get_field_content(i,"budget",temp); fData[TotFacs][fBudget] = strval(temp); fData[TotFacs][fCreated] = true; printf("[Slot %i] %s Loaded.",TotFacs,fData[TotFacs][fTitle]); } } } } return 1; }