stock LoadServer()
{
new
Query[128],
Data;
format(Query, 128, "SELECT * FROM serverdata WHERE Enabled = 1");
mysql_query(Query);
mysql_store_result();
Data = mysql_num_rows();
mysql_free_result();
if(Data >= 1)
{
mysql_query(Query);
mysql_store_result();
while(mysql_fetch_row_format(Query, "|"))
{
new
Enabled[128],
Value[128];
mysql_fetch_field_row(Enabled, "Enabled");
/* #pragma unused Enabled
Calgon suggested removing this but it did not fix the error. */
mysql_fetch_field_row(Server[sName], "Name");
mysql_fetch_field_row(Server[sVersion], "Version");
mysql_fetch_field_row(Server[sMap], "Map");
mysql_fetch_field_row(Server[sWebsite], "Website");
mysql_fetch_field_row(Server[sTime], "Time");
mysql_fetch_field_row(Value, "Hour");
Server[sHour] = strval(Value);
mysql_fetch_field_row(Value, "Minute");
Server[sMinute] = strval(Value);
mysql_fetch_field_row(Value, "Second");
Server[sSecond] = strval(Value);
mysql_fetch_field_row(Server[sDate], "Date");
mysql_fetch_field_row(Value, "Year");
Server[sYear] = strval(Value);
mysql_fetch_field_row(Value, "Month");
Server[sMonth] = strval(Value);
mysql_fetch_field_row(Server[sMonthName], "MonthName");
mysql_fetch_field_row(Value, "Day");
Server[sDay] = strval(Value);
mysql_fetch_field_row(Value, "Weather");
Server[sWeather] = strval(Value);
mysql_fetch_field_row(Server[sOwner], "Owner");
mysql_fetch_field_row(Server[sCoOwner], "CoOwner");
mysql_fetch_field_row(Server[sScripter], "Scripter");
mysql_fetch_field_row(Server[sMapper], "Mapper");
}
mysql_free_result();
}
return 1;
}
[21:30:08] >> mysql_query( Connection handle: 1 ) [21:30:08] CMySQLHandler::Query(SELECT * FROM serverdata WHERE Enabled = 1) - Successfully executed. [21:30:08] >> mysql_store_result( Connection handle: 1 ) [21:30:08] CMySQLHandler::StoreResult() - Result was stored. [21:30:08] >> mysql_fetch_row_format( Connection handle: 1 ) [21:30:08] CMySQLHandler::FetchRow() - Return: 1|TheLazySloth's Server|0.3c R5|Red County|forum.sa-mp.com|20:03:34|20|3|34|11/20/2011|2011|11|November|20|2|TheLazySloth|Unknown|TheLazySloth|TheLazySloth [21:30:08] >> mysql_fetch_field_row( Connection handle: 1 ) [21:30:08] CMySQLHandler::FetchField("Enabled") - 1 [21:30:08] >> mysql_fetch_field_row( Connection handle: 1 ) [21:30:08] CMySQLHandler::FetchField("Name") - TheLazySloth's Server [21:30:08] >> mysql_fetch_field_row( Connection handle: 1 ) [21:30:08] CMySQLHandler::FetchField("Version") - 0.3c R5 [21:30:08] >> mysql_fetch_field_row( Connection handle: 1 ) [21:30:08] CMySQLHandler::FetchField("Map") - Red County [21:30:08] >> mysql_fetch_field_row( Connection handle: 1 ) [21:30:08] CMySQLHandler::FetchField("Website") - forum.sa-mp.com [21:30:08] >> mysql_fetch_field_row( Connection handle: 1 ) [21:30:08] CMySQLHandler::FetchField("Time") - 20:03:34 [21:30:08] >> mysql_fetch_field_row( Connection handle: 1 ) [21:30:08] CMySQLHandler::FetchField("Hour") - 20 [21:30:08] >> mysql_fetch_field_row( Connection handle: 1 ) [21:30:08] CMySQLHandler::FetchField("Minute") - 3 [21:30:08] >> mysql_fetch_field_row( Connection handle: 1 ) [21:30:08] CMySQLHandler::FetchField("Second") - 34 [21:30:08] >> mysql_fetch_field_row( Connection handle: 1 ) [21:30:08] CMySQLHandler::FetchField("Date") - 11/20/2011 [21:30:08] >> mysql_fetch_field_row( Connection handle: 1 ) [21:30:08] CMySQLHandler::FetchField("Year") - 2011 [21:30:08] >> mysql_fetch_field_row( Connection handle: 1 ) [21:30:08] CMySQLHandler::FetchField("Month") - 11 [21:30:08] >> mysql_fetch_field_row( Connection handle: 1 ) [21:30:08] CMySQLHandler::FetchField("MonthName") - November [21:30:08] >> mysql_fetch_field_row( Connection handle: 1 ) [21:30:08] CMySQLHandler::FetchField("Day") - 20 [21:30:08] >> mysql_fetch_field_row( Connection handle: 1 ) [21:30:08] CMySQLHandler::FetchField("Weather") - 2 [21:30:08] >> mysql_fetch_field_row( Connection handle: 1 ) [21:30:08] CMySQLHandler::FetchField("Owner") - TheLazySloth [21:30:08] >> mysql_fetch_field_row( Connection handle: 1 ) [21:30:08] CMySQLHandler::FetchField("CoOwner") - Unknown [21:30:08] >> mysql_fetch_field_row( Connection handle: 1 ) [21:30:08] CMySQLHandler::FetchField("Scripter") - TheLazySloth [21:30:08] >> mysql_fetch_field_row( Connection handle: 1 ) [21:30:08] CMySQLHandler::FetchField("Mapper") - TheLazySloth [21:30:08] >> mysql_fetch_row_format( Connection handle: 1 ) [21:30:08] >> mysql_free_result( Connection handle: 1 ) [21:30:08] CMySQLHandler::FreeResult() - Result was successfully free'd.
#pragma unused Enabled
mysql_query("CREATE TABLE IF NOT EXISTS serverdata \ (\ Enabled int NOT NULL DEFAULT '1', \ Name varchar(128), \ Version varchar(128), \ Map varchar(128), \ Website varchar(128), \ Time varchar(128), \ Hour int, \ Minute int, \ Second int, \ Date varchar(128), \ Year int, \ Month int, \ MonthName varchar(128), \ Day int, \ Weather int, \ Owner varchar(128), \ CoOwner varchar(128), \ Scripter varchar(128), \ Mapper varchar(128), \ PRIMARY KEY (Enabled)\ )"); |