How do I connect to an external Database?

So, I want to connect to an external online database and searching here i found the VaRest plugin to use to do it, but I don’t know how.

If you guys just help me to stabilish the connection with the DB I can go further.

This is the plugin i’m using:

Thanks for the help

I´m having this same issue… Please someone help :confused:

VaRest is just for for HTTP communication, you need to have a HTTP server that reads DB and return result in form to use VaRest. But again VaRest is for HTTP, it does not really need to be used just for databases

Do you even have an external database/API that will accept get requests and return data?

I am using VaRest because I found the UE4AM example and thought it would be the solution, web is not my strong side.

Can you explain me how I can make this communication, or how I can make the connection directly from C++ on the engine ? (i don’t need any kind of security right now)

Thanks, man

What you to use database for?

So you want to do server side only access?

To storage images and some users info, like username, password, email…

I use MySQL with PHP Version 5.6.12 for an online database.

But initially if it works only on localhost it’s fine.

Connecting to the database really depends on what database you’re connecting too. Is is one of the AWS offerings / Azure offerings / MongoDB / Parse? There are many out there and each will have a slightly different interface. The actual type of database you use will have an impact to (SQL / NoSQL etc)

Personally, Id suggest that if you’re not familiar with these things you should consider Parse, which is well supported and helps mix DB technologies to fit your needs (NoSQL is much faster, but not always appropriate depending on what you’re trying to do).

The actual process of connecting will usually be firing off a http (hopefully https) web request to some end-point and you’ll usually include your username and password (or hopefully a access token) to authenticate as a user which can read and / or write to the database. You’ll probably need to wait till you get a response from that call, which will probably also include a cookie or access token so you don’t constantly need to re-authenticate.

From there, the actual calls you make will depend on what you want to do. To get a db record for your highscore for example you’ll send a https to something like /mysevice/mydb/getscore?id=100292, and you’ll get a response from that which you then parse and do with as you want.

Posting data to the database is very similar, but you’ll probably need to construct some more parameters with the http request, as well as format your data as a / xml request (depending on the service). Some will just let you pass in the data as http query strings but it does depend on the service and the purpose.

As the data you send / receive will probably be in , you’ll need to use a parser to understand that. The exact structure of that will again depend on the service and you’re implementation of the database.

Sorry that there isn’t anything specific in there, but like I said, without knowing your service we can’t be too much help. If you’re planning on hosting your own DB then think very, very carefully before you do. It’s very easy to trip yourself up and make big mistakes without understanding both the underlying DB tech and the associated web service.

Phil_me_up, I am looking for some webserver connection support can you help me - email

I have an external database done, using php Admin. If i am right, i understand that if a want to make a connection between my game and external database from HTTP, all i need to do is installing VaRest?

I´ve found a tutorial that explains that, but i´m still trying to make it work.

I´m using database for Login screen and save some info input and other things.

I´ll try to follow this tutorial and i would tell you if i solve this.