25.06.2015, 11:28
I used that "technique" to build long query strings:
PHP Code:
new query[1024]; // long string with sql query
new tmp[64];
format( query, 1024, "UPDATE players SET " );
format( tmp, 64, "age = %i, ", player[playerid][AGE] );
strcat( query, tmp );
format( tmp, 64, "health = %0.2f, ", player[playerid][HEALTH] );
strcat( query, tmp );
// ...
format( tmp, 64, "money = %i ", player[playerid][MONEY] );
strcat( query, tmp );
format( tmp, 64, "WHERE id = %i;", player[playerid][BASEID] );
strcat( query, tmp );
mysql_query( mysql, query );