22.02.2011, 06:04
Код:
LoadOcps() { mysql_debug(1); new query[256],tmp; format(query,sizeof(query),"SELECT * FROM `ocps`"); mysql_query(query); mysql_store_result(); tmp=mysql_num_rows(); for(new i=0;i<tmp;mysql_retrieve_row(i++)) { new field[13][128]; if(mysql_num_rows() == 0) continue; mysql_fetch_row_format(query, "|"); explode(query, field, "|"); new cpid,Float:x,Float:y,Float:z; x=strval(field[1]); y=strval(field[2]); z=strval(field[3]); cpid=CreateDynamicCP(x,y,z,1.0,-1,-1,-1,100.0); corg[cpid]=strval(field[0]); printf("%d",corg[cpid]); } mysql_debug(0); mysql_free_result(); return 1; }
Код:
[11:55:08] --------------------------- [11:55:08] MySQL Debugging activated (02/22/11) [11:55:08] --------------------------- [11:55:08] [11:55:08] >> mysql_query( Connection handle: 1 ) [11:55:08] CMySQLHandler::Query(SELECT * FROM `ocps`) - Successfully executed. [11:55:08] >> mysql_store_result( Connection handle: 1 ) [11:55:08] CMySQLHandler::StoreResult() - Result was stored. [11:55:08] >> mysql_num_rows( Connection handle: 1 ) [11:55:08] CMySQLHandler::NumRows() - Returned 3 row(s) [11:55:08] >> mysql_num_rows( Connection handle: 1 ) [11:55:08] CMySQLHandler::NumRows() - Returned 3 row(s) [11:55:08] >> mysql_fetch_row_format( Connection handle: 1 ) [11:55:08] CMySQLHandler::FetchRow() - Return: 3|2445.82788|-2547.99756|17.91065 [11:55:08] >> mysql_retrieve_row( Connection handle: 0 ) [11:55:08] >> mysql_retrieve_row() - Invalid connection handle. (You set: 0, Highest connection handle ID is 1). [11:55:08] >> mysql_num_rows( Connection handle: 1 ) [11:55:08] CMySQLHandler::NumRows() - Returned 3 row(s) [11:55:08] >> mysql_fetch_row_format( Connection handle: 1 ) [11:55:08] CMySQLHandler::FetchRow() - Return: 4|1548.00293|-1681.15503|13.55938 [11:55:08] >> mysql_retrieve_row( Connection handle: 1 ) [11:55:08] >> mysql_num_rows( Connection handle: 1 ) [11:55:08] CMySQLHandler::NumRows() - Returned 3 row(s) [11:55:08] >> mysql_fetch_row_format( Connection handle: 1 ) [11:55:08] >> mysql_retrieve_row( Connection handle: 2 ) [11:55:08] >> mysql_retrieve_row() - Invalid connection handle. (You set: 2, Highest connection handle ID is 1). [11:55:08] --------------------------- [11:55:08] MySQL Debugging de-activated [11:55:08] ---------------------------