Posted 04 February 2015 - 06:47 PM
I was bored and had nothing to do so I made a database API. Currently, it only has 3 functions. The functions are:
addUser(user)
setPath(path)
retreiveUsers()
This is how you would use the API:
pastebin get nQL5QBGX databaseAPI
addUser(user)
setPath(path)
retreiveUsers()
This is how you would use the API:
os.loadAPI("databaseAPI") -- The name of the API
databaseAPI.setPath("path") -- Sets the path of where the users will be, by default it will be "users"
databaseAPI.addUser("user") -- Adds a user to the table
for k, v in ipairs(databaseAPI.retreiveUsers()) do --Uses ipairs so it is in order and needs to be in a loop
print(v)
end
pastebin get nQL5QBGX databaseAPI
Edited on 04 February 2015 - 05:47 PM