26.06.2012, 16:20
Hy!
I tried a lot of different save types, like one query for all data (example:
)
or more querys for one data like this:
Totally, i have over 135 player-values to save in the MySQL-database. The problem is, that the server returns a UNKNOWN Command when i'm using the save command for each player (in a foreach-loop the public for saving data is executed). Now i want to know what is the fastest, most resource-efficient method for saving data? Remember, i have to push the size of the query string when i'm putting all in one string.
Im lookin' forward to your help!
I tried a lot of different save types, like one query for all data (example:
Код:
format(query,sizeof(query),"UPDATE players SET Password = '%s',Level = '%d',Age = '%d' (and a lot of more...) WHERE Name = '%s' LIMIT 1", PlayerValue[playerid][pKey], PlayerValue[playerid][pPlayerLevel],PlayerValue[playerid][pAge], name); mysql_query(query);
or more querys for one data like this:
Код:
format(query,sizeof(query),"UPDATE players SET Password = '%s' WHERE Name = '%s' LIMIT 1", PlayerValue[playerid][pKey], name); mysql_query(query); format(query,sizeof(query),"UPDATE players SET PlayerLevel = '%d' WHERE Name = '%s' LIMIT 1", PlayerValue[playerid][pPlayerLevel], name); mysql_query(query); format(query,sizeof(query),"UPDATE players SET Age= '%d' WHERE Name = '%s' LIMIT 1", PlayerValue[playerid][pAge], name); mysql_query(query);
Im lookin' forward to your help!