Lloyd Logan Posted January 13, 2013 Posted January 13, 2013 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
Raahim Posted January 13, 2013 Posted January 13, 2013 Just to let you know, if the scripts are Illegal ones, no one would help you.
Lloyd Logan Posted January 13, 2013 Author Posted January 13, 2013 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!
Castillo Posted January 13, 2013 Posted January 13, 2013 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.
csiguusz Posted January 13, 2013 Posted January 13, 2013 You dont have to "connect your server to mysql". Just the scripts can connect to a database or éven use a database file to store there information. For example check the dbConnect function.
Lloyd Logan Posted January 13, 2013 Author Posted January 13, 2013 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?
Castillo Posted January 13, 2013 Posted January 13, 2013 As the person above said, you must connect to mysql with dbConnect.
Lloyd Logan Posted January 13, 2013 Author Posted January 13, 2013 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
Lloyd Logan Posted January 13, 2013 Author Posted January 13, 2013 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
Lloyd Logan Posted January 13, 2013 Author Posted January 13, 2013 Click it, it has examples. **facepalm** Sorry! So will i need the modules for this to work?
csiguusz Posted January 13, 2013 Posted January 13, 2013 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.
Lloyd Logan Posted January 13, 2013 Author Posted January 13, 2013 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?
Castillo Posted January 13, 2013 Posted January 13, 2013 No, executeSQLQuery is for the built-in SQLite of MTA, you must use: dbExec
csiguusz Posted January 13, 2013 Posted January 13, 2013 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now