Advertisement
Guest User

Untitled

a guest
Aug 16th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. require('mysqloo')
  2. require('hio')
  3.  
  4. local DATABASE_HOST = "localhost"
  5. local DATABASE_PORT = 3306
  6. local DATABASE_NAME = "database"
  7. local DATABASE_USERNAME = "root"
  8. local DATABASE_PASSWORD = "root"
  9. local DATABASE_SOCKET = "/var/run/mysqld/mysqld.sock" -- window's doesn't use this.
  10.  
  11. local DBOBJ
  12.  
  13. DBOBJ = mysqloo.connect(DATABASE_HOST, DATABASE_USERNAME, DATABASE_PASSWORD, DATABASE_NAME, DATABASE_PORT)
  14.  
  15. DBOBJ.onConnected = function(db)
  16. print(db, "connected!")
  17.  
  18. local getAllPlayers = db:query([[SELECT * FROM `sgcclan_vbforums`.`serverplayed` WHERE last_seen < "2010-11-01 00:00:01" LIMIT 1,50000]])
  19. getAllPlayers.onData = function(Q, D)
  20. local steamid = D["steamid"]
  21.  
  22. hIO.RemoveDirectory("C:\\srcds\\garrysmod\\data\\advdupe\\"..steamid.."\\)
  23.  
  24. print(steamid, "saves have been removed!")
  25. end
  26. getAllPlayers.onError = function(Q, E) print(E) end
  27. getAllPlayers:start()
  28. end
  29.  
  30. DBOBJ.onConnectionFailed = function(db, err)
  31. print(db, "connection failed", err)
  32. end
  33.  
  34. DBOBJ:connect()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement