20.12.2010, 21:10
pawn Code:
stock LoadHousesFromDatabase()
{
new Query[255],datavar[6],datastr[1][28],Float:datafloat[7];
mysql_query("SELECT * FROM `Houses` ORDER BY `Houses`.`Houseid` ASC LIMIT 0,260");
mysql_store_result();
if(mysql_num_rows() > 0)
{
while(mysql_fetch_row_format(Query,"|"))
{
sscanf(Query,"p<|>ds[27]dfffffffdddd",datavar[0],datastr[0],datavar[1],datafloat[0],datafloat[1],
datafloat[2],datafloat[3],datafloat[4],datafloat[5],datafloat[6],datavar[2],datavar[3],datavar[4],datavar[5]);
CreateHouse(datavar[0], datafloat[1], datafloat[2], datafloat[3],datafloat[0], datafloat[4],datafloat[5],datafloat[6], datavar[2], datavar[4], datavar[5]);
}
}
mysql_free_result();
return 1;
}
Code:
[13:07:42] CMySQLHandler::Query(SELECT * FROM `Houses` ORDER BY `Houses`.`Houseid` ASC LIMIT 0,260) - Successfully executed. [13:07:42] >> mysql_store_result( Connection handle: 1 ) [13:07:42] CMySQLHandler::StoreResult() - Result was stored. [13:07:42] >> mysql_num_rows( Connection handle: 1 ) [13:07:42] CMySQLHandler::NumRows() - Returned 242 row(s) [13:07:42] >> mysql_fetch_row_format( Connection handle: 1 ) [13:07:42] CMySQLHandler::FetchRow() - Return: 0|Nothing|0|27.38|1452.31|2773.87|266.57|2324.41|-1145.56|1050.71|12|250148|0|0|Unbought|0|0|0|0|Nobody||0|0|0||||||0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0 [13:07:42] >> mysql_query( Connection handle: 1 ) [13:07:42] CMySQLHandler::Query(SELECT * FROM Houses WHERE Houseid = 0 LIMIT 1) - Successfully executed. [13:07:42] >> mysql_store_result( Connection handle: 1 ) [13:07:42] CMySQLHandler::StoreResult() - Result was stored. [13:07:42] >> mysql_num_rows( Connection handle: 1 ) [13:07:42] CMySQLHandler::NumRows() - Returned 1 row(s) [13:07:42] >> mysql_fetch_row_format( Connection handle: 1 ) [13:07:42] CMySQLHandler::FetchRow() - Return: 0|Nothing|0|27.38|1452.31|2773.87|266.57|2324.41|-1145.56|1050.71|12|250148|0|0|Unbought|0|0|0|0|Nobody||0|0|0||||||0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0 [13:07:42] >> mysql_free_result( Connection handle: 1 ) [13:07:42] CMySQLHandler::FreeResult() - Result was successfully free'd. [13:07:42] >> mysql_free_result( Connection handle: 1 ) [13:07:42] CMySQLHandler::FreeResult() - The result is already empty.