Wep stats? Large database

Started by Debian, Sep 13, 2015, 10:04 AM

Previous topic - Next topic

Debian

I made a wep stats but it has large database like 32 queries and i made it to store the values in a array , So that means each time when a player logins it makes 32 queries at a time . Does that make a lot of lag? any way to make it better?

Thijn

Would be easily possible with just 1 query. Show your code.

Debian

#2
Yes, i just got wrong meaning of query , its 1query but when player registers ,query inserts 32 items, and when player exits query updates 32 items,  when player types /wstats cmd

::QuerySQL( dbGlobal, "INSERT INTO Wstats ( NameLower, Fist, BrassKnuckle, ScrewDriver, GolfClub, NightStick, Knife, BaseballBat, Hammer, Cleaver, Machete, Katana, Chainsaw, Grenade, RemoteGrenade, TearGas, Molotov, Missile, Colt45, Python, Shotgun, Spaz , Stubby, Tec9, Uzi, Ingrams, MP5, M4, Ruger, SniperRifle, LaserScope, RocketLauncher, FlameThrower, M60 ) VALUES ( '" + player.Name.tolower() + "', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 )" );

Thijn

In that case it wont lag that much.