only two cps load =(
#1

Код:
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;
}
idk if i increase the rows only the first to load and the 2nd one keeps repeating until all the rows are done =(

Код:
[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] ---------------------------
Reply
#2

mysql_retrieve_row(i++) should be mysql_retrieve_row() i guess.
Reply
#3

in that case the second one shouldnt be loading too. btw i use the same code to load the dealer which works fine
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)