Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help MySQL DataBase saving kills
#11
coz we're pro's? Troll
Reply

#12
Just do
Code:
OnPlayerDamaged
if damage > victim health then
{
try {
create and open a sql connection
create a sql command
tell it to update the table containing the points where the xuid matches
close the connection
} catch (sql exception) {}
}

You're doing more work than you should in your code


to read
Code:
try {
create and open a sql connection
create a sql command
create an int to store the points
set the sql command to read
read the table where the xuid matches
set the int to the result column
close the connection
print out the value to server/chat
} catch (sql exception) {}
Reply

#13
Opening and closing the connection uses a lot more server resource and isn't efficient, using a persistent connection is just as safe and saves having the extra overhead of re-creating the same connection.
I now host all my MW3 projects on my private GIT repo
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.