Posts: 27
Threads: 1
Joined: Feb 2017
I dont got your question but can you show me your query var?
Posts: 408
Threads: 40
Joined: Nov 2014
Reputation:
0
You can divide that in multiple mysql_format , and use mysql_tquery insteed of mysql_query , i'm surprise that you not say anything by some lag out of that , becasue you says is 120 data so alot of time to send that.
And why you need to save all that in a OneMinuteTimer? I mean WTF
Update the databse only when that values change, of course , for some data it's need that, but not for all that.
Posts: 27
Threads: 1
Joined: Feb 2017
I dont think so. You Can Use \ To Make Your Format Like
PHP код:
mysql_format(mysql, query, sizeof(query), "UPDATE users SET \
level=%d, \
money=%d admin=%d lsd=%d cocaine=%d WHERE nick='%s'", score, money, pname, admin, lsd, cocaine);
Posts: 10,066
Threads: 38
Joined: Sep 2007
Reputation:
0
It's really simple: don't update shit that doesn't need updating. Update stuff immediately, as and when it changes. Yes, you will have more queries overall but they will be short and fast, compared to the huge ones (in a loop, no less) that you're doing now. Also use the primary key (the id) for updating instead of the name. Text searches in SQL are SLOW and the problem will only get worse as the table grows larger.
Posts: 10,066
Threads: 38
Joined: Sep 2007
Reputation:
0
Every table should have a primary key. The primary key is a field or a combination of fields that can uniquely identify the row in the table. Theoretically you can make the name the primary key because it's supposed to be unique, but text searches are slow (like I said before). Most people will put the primary key as the first column(s) in the table but it doesn't really matter where it is placed.
Just create an int column, tick auto_increment (may be abbreviated A_I in phpMyAdmin) and then click 'primary key'. It should automatically assign an ID to existing rows. Then in your script create a new specifier in your enum and call it SQLID or something like that. For further updates you use that instead of the name.