24.02.2014, 14:20
So i have this code. It should update my car stats
But i got the problem, it only updates the first public. As i can see from mysql_log:
What could be the problem?
Код:
UpdateCarFlo(car, "PosX", CarInfo[car][PosX]); UpdateCarFlo(car, "PosY", CarInfo[car][PosY]); ......
Код:
public UpdateCarFlo(sCarId, sValue[], Float:sFlo) { new query[140]; format(query, sizeof(query), "UPDATE scriptcars SET %s = %f WHERE ID = %d", sValue, sFlo, sCarId); mysql_function_query(gSQL, query, false, "SendQuery", ""); }
Код:
[17:13:42] >> mysql_query_callback( Connection handle: 1 ) [17:13:42] >> mysql_query_callback( Connection handle: 1 ) [17:13:42] >> mysql_query_callback( Connection handle: 1 ) [17:13:42] Passing query UPDATE scriptcars SET PosX = 664.403991 WHERE ID = 0 | [17:13:42] >> mysql_query_callback( Connection handle: 1 ) [17:13:42] >> mysql_query_callback( Connection handle: 1 ) [17:13:42] >> mysql_query_callback( Connection handle: 1 ) [17:13:42] ProcessQueryThread(SendQuery) - Query was successful. (UPDATE scriptcars SET PosX = 664.403991 WHERE ID = 0) [17:13:42] CMySQLHandler::ProcessQueryThread() - Data is getting passed to ->ProcessTick() [17:13:42] >> mysql_query_callback( Connection handle: 1 ) [17:13:42] >> mysql_query_callback( Connection handle: 1 ) [17:13:42] >> mysql_query_callback( Connection handle: 1 ) [17:13:42] >> mysql_query_callback( Connection handle: 1 ) [17:13:42] >> mysql_query_callback( Connection handle: 1 ) [17:13:42] >> mysql_query_callback( Connection handle: 1 )