Jump to content

[HELP]MySQL Saving Skin, Money, IP


Recommended Posts

Hey all, I have a few questions. I'm trying to work out how to save skins, money, and IPs into a MySQL database using the MySQL module. I'm still trying to get used to LUA, so it's slightly confusing to me.

How would I go about doing this? Thank you for any help given.

Link to comment

Doing this with the MySQL module is actually quite easy:

local host = "localhost" 
local user = "root" 
local pass = "123456" 
local db = "mta" 
  
local cmdstring = "INSERT INTO `accounts` (username, skin, money, ip) VALUES ('"..username.."', "..skin..", " ..money.. ", '" ..ipaddress .. "')" 
local result = mysql_query(connection, cmdstring) 
if(result) then 
    --saving was successful 
end 
  

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...