Advertisement
Guest User

Untitled

a guest
Feb 16th, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. --[[------ End Of SQL Variables -------]]--
  2. require ("mysqloo")
  3.  
  4. local DATABASE_HOST = AltCheck.SQL.Host
  5. local DATABASE_PORT = AltCheck.SQL.Database_port
  6. local DATABASE_NAME = AltCheck.SQL.Database_name
  7. local DATABASE_USERNAME = AltCheck.SQL.User
  8. local DATABASE_PASSWORD = AltCheck.SQL.Host
  9. --[[------ Start Of SQL Variables -------]]--
  10.  
  11.  
  12. --[[------ Start Of SQL Connection -------]]--
  13. function connectToDatabase()
  14. databaseObject = mysqloo.connect(DATABASE_HOST, DATABASE_USERNAME, DATABASE_PASSWORD, DATABASE_NAME, DATABASE_PORT)
  15. databaseObject.onConnected = function() print("AltCheck has connected to the database!") end
  16. databaseObject.onConnectionFailed = function() print("AltCheck has failed to connect to the database! Please investigate") end
  17. databaseObject:connect()
  18. end
  19.  
  20. connectToDatabase()
  21. --[[------ End Of SQL Connection -------]]--
  22.  
  23.  
  24. --[[------ Create Database Tables -------]]--
  25.  
  26. --[[------ Figure this out later ------]]--
  27.  
  28. --[[------ Database Tables Created -------]]--
  29.  
  30.  
  31. function AddUser ( ply )
  32. sql.Query( "INSERT INTO PlayerConnection (SteamID, IP) VALUES (?, ?) ON DUPLICATE KEY UPDATE Connections = Connections + 1")
  33. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement