Jump to content
xisto Community
t3jem

Database With Mysql++ getting mySQL++ to work with trap17

Recommended Posts

Hi, I'm trying to build an online game and figured the easiest way to do the server list would be to make a mySQL database for it; however, I use the con() command on the IP i get from pinging my website and I always get an abnormal program termination; however, it will work with the mySQL on my own machine.

The code is below:

#include <iostream>#include <iomanip>#include <mysql++>#include "pass.h"//holds my password (i program at school)int main(void){	Connection con("t3jem3_test","64.69.46.210","t3jem3_t3jem",pass);	Query query = con.query();	query << "SELECT * FROM test";	Result res = query.store();	Result::iterator i;	Row row;	for(i = res.begin(); i!=res.end(); i++)	{		row = *i;		cout << setw(6) << row["id"] << setw(10) << row["sname"] << endl;	}	::Sleep(5000);	return 0;}

This code was taken almost straight out of my multiplayer games programming book.

Other vital info: The site my database is hosted on it right here at Xisto (t3jem.trap17.com).

Any help is appreciated, thanks in advance!

Share this post


Link to post
Share on other sites

I dont think Xisto allows mysql connections outside its own server. That could be your problem, try running a local mysql server and see if it works for you there.

Share this post


Link to post
Share on other sites

The correct name for the mysql server is "localhost" and the above post by sonesay is correct in that you will not be able to connect to the Xisto Mysql Server from your own Desktop Command Prompt or from your school. The Mysql server is only available via your Xisto Hosting Account Cpanel, or a script in one of your files on your account.

Share this post


Link to post
Share on other sites

im not sure i think it only alows sub mysql witch is easy to do1. open mysql Query Browser press tools MySQL admin.2.window should pop up press user admin.3. click add user make ID pw .4.then go to schema priv and let it have what u want like acount making and all after done. use it to log in to ur things.if this wont help im not sure

Share this post


Link to post
Share on other sites

I suggest using php to create a secure backend that your game can connect to and send and load data from. This way you shouldn't have any issues with permissions.

Share this post


Link to post
Share on other sites

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

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.