Jump to content
Am4z3d

Connect Database (SQL) with mission

Recommended Posts

Hey there!

I am planning to create a mission for which I need some kind of database to show stats on a website. The best way would be a SQL-DB because I am familiar with SQL.

But i honestly have no clue how to access the database within the SQF code. And the only thing I find on google is "How to set up a DB for Altis Life or Exile"...

 

Does anyone knows how to do this?

 

I would really appreciate the help   :)

 

Greetings

Amazed

Share this post


Link to post
Share on other sites

If I was you I would use extDB3. This is an extension for Arma which allows you to connect and retrieve/set data from MariaDB/MySQL databases. The usage of extDB3 can be found here. Also to present the data from the MySQL database for example on a website, I assume you will need some experience within php. Additionally if you do scrap the idea of presenting the data on a website and so forth you could just use iniDB which from personal experience is quite reliable. Hopefully this briefly helped you. 

Share this post


Link to post
Share on other sites

Here's a link to Arma2NETMySQLPlugin 

 

Don't the the name deceive you, its for arma 3 as well.

 

to do a basic call to the database is pretty simple;

_selectTest = "Arma2Net.Unmanaged" callExtension "Arma2NETMySQLCommand ['weapons', 'SELECT * FROM users LIMIT 3']";
In this example, “weapons†is the database name. The next portion is the entire SQL query which you will need to create manually. This will block until the database call is complete and the result is returned.

Share this post


Link to post
Share on other sites

Additionally if you do scrap the idea of presenting the data on a website

 

You can use iniDB for that too. Those ini-files can easily be read by a php script via ftp directly from your gameserver.

  • Like 1

Share this post


Link to post
Share on other sites

You can use iniDB for that too. Those ini-files can easily be read by a php script via ftp directly from your gameserver.

 

Oh I never knew that, very nice! Thanks for letting me know  :o

Share this post


Link to post
Share on other sites

Thank you for your help so far...  :)

 

I'll try it myself... If I need any help I let you know.

Share this post


Link to post
Share on other sites
On 8.11.2016 at 11:53 AM, Tajin said:

 

You can use iniDB for that too. Those ini-files can easily be read by a php script via ftp directly from your gameserver.

So this means that i could use iniDB/iniDBI2 for a multi server setup aswell?

Can you give me a hint how to do this? I have no clue how to implement php code into sqf to access ftp files.

 

Sry for warming up this thread btw :don11:

Share this post


Link to post
Share on other sites

If you want to interract with a website that is not local to arma server, it s easier to use a db like mysql with extDB3.

 

 

 

 

  • Like 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×