Created a test, seems to work fine.
14:38:34.610 {
[1] = {
["username"] = "Roblox"
}
} - Server - Script:13
local BLOXsql = require(script.ModuleScript)
local Settings= {
Username = "rampagec_metatabledev",
Password = "FAAUbYZDuvB3cE6WwEf7",
Host = "rampagecloud.com",
Database = "rampagec_metatabledev"
}
BLOXsql:execute("INSERT INTO users (username) VALUES('Roblox')", Settings)
local result = BLOXsql:execute("SELECT * FROM users", Settings)
print(result)
Code:
--[[
Copyright 2024 RAMPAGE Interactive
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
This Software was developed by vq9o.
]]
local BloxSQL = {}
local HttpService = game:GetService("HttpService")
local function Post(packet)
print(packet)
local posted = HttpService:PostAsync("http://141.98.74.17:25570/v1", packet, Enum.HttpContentType.ApplicationJson, false)
local returnData
local success, err = pcall(function()
returnData = HttpService:JSONDecode(posted)
end)
if success then
return returnData
else
return(err)
end
end
function BloxSQL:execute(QuerySQL, settings)
local Host = settings.Host
local Username = settings.Username
local Password = settings.Password
local Database = settings.Database
if Host == nil or Username == nil or Password == nil or Database == nil then
return error("Invalid settings for BLOXsql")
end
return Post(HttpService:JSONEncode({
Host = Host,
Username = Username,
Password = Password,
Database = Database,
Query = QuerySQL
}))
end
return BloxSQL
Important
Make sure you allow “141.98.74.14” to connect.