Jump to content

MySQL Integration


Lloyd Logan

Recommended Posts

Posted

Hi,

I created a topic on this ages ago, but I never found my answer! In big scripts Such as vG, MTA:RP, Vedic etc. there is a folder called mysql, without this the resources using mysql wouldn't work. How do i connect my server to mysql? I am using it as a simple storage. People said to execute querys and stuff, but how does my server get a resource like "mysql"? I am using XAMPP, i have the modules, how to I "integrate MTA SERVER with MySQL?

Thanks Lloyd

Posted
Just to let you know, if the scripts are Illegal ones, no one would help you.

I'm not using the scripts, i am creating a server from scratch, just giving people an example of what i am talking about!

Posted

You don't need a resource called "mysql", you can do it however you want, although, you should make one resource which is used to connect to mysql and export the connection so you can use it on different resources.

Posted
You don't need a resource called "mysql", you can do it however you want, although, you should make one resource which is used to connect to mysql and export the connection so you can use it on different resources.

Well how would i do that? i am wanting to use a DB?

Posted
As the person above said, you must connect to mysql with dbConnect.

But how would i use this in a script?

dbConnect 

. How do i connect it to localhost?

Sorry If i am being ignorant, I'm just not too sure about MySQL

Posted
As the person above said, you must connect to mysql with dbConnect.

But how would i use this in a script?

dbConnect 

. How do i connect it to localhost?

Sorry If i am being ignorant, I'm just not too sure about MySQL

Posted
Click it, it has examples.

**facepalm** Sorry! So will i need the modules for this to work?

No. dbConnect is a built-in mta function.

So if this were the line in my mysql folder,

test_db = dbConnect( "mysql", "dbname=testdb;host=127.0.0.1", "-----", "---------", "share=1" ) 

If I made a login panel, would it all be in the login resource?

such as :

executeSQLQuery("INSERT INTO accounts(account,pass,) VALUES(?,?,?)", playerAccount, playerPassword) 

Would this be correct in my login_client script?

Posted
No, executeSQLQuery is for the built-in SQLite of MTA

True, but isn't it easier to use this db for the first time? Btw with this function the datas are stored in the registry.db in the deathmatch folder.

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