Which MySQL safe method is bether?
#1

Hy!

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);
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!
Reply
#2

pawn Код:
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);
This one
Reply
#3

But make the string-size no problems with the performance or make this no matter?

Because i think the size will be over > 600 and when 40 players or more are connected it will lagg or?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)