15.04.2015, 14:20
Tip to make INSERT query short is that while creating table don't forget to set default value of the column so that you don't need to insert that value with the query. For example if you set default of Admin money and score to 0 then you have to just use name password and ip in insert query and rest will be set to 0 by default.
The tip to make UPDATE query shorter is:
The tip to make UPDATE query shorter is:
Quote:
Hey Jimmy, it's been awhile ! Another way would be removing a few of what you're saving and save them separately when they need to be saved.
E.G `admin` - You'd only need to save that whenever it gets changed, so upon the promoting / demoting admin command just save it then. `score` - Depending how often a player gets score it might not really matter but you could create your own score function and save the new score var when they're given a score. `money` - Similar to above, save the players money value whenever they gain / lose money. This way their money data will be up to date if the server happens to crash and the server can't save the data that occoured after the last saving point. Exp, Level, Kills Deaths - You get the point, save it when the player gets killed / kills somebody else. Now your query is only 419 characters long, allow some space for the larger values (many 50-80 characters or so). There's nothing wrong with a decent sized query, it has to be saved somehow lol. pawn Код:
|