Jump to content

Is it good to switch to XML?


MetaGamer

Recommended Posts

  
function MysqlInit() 
    handler = mysql_connect("", "", "", "", "") -- Establish the connection 
    if ( not handler ) then -- The connection failed 
      outputDebugString("Unable to connect to the MySQL server") 
    else 
      mysql_close(handler) -- Close the connection 
    end 
end 
addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), MysqlInit) 
  

Link to comment

Just for the record, XML will almost always be worse for anything that isn't configuration information - if you expect the information you want to save to change often (e.g. new players joining, etc), then it's a bad choice. If you want to quickly find an item, then it's a bad choice. If you just want to load something up on server start up, then it's fine.

Every time you save an XML file you rewrite the entire file, which takes quite some time.

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...