|
|
|
|
![]() ![]() |
Mar 7 2008, 02:29 AM
Post
#1
|
|
|
Privileged Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 506 Joined: 9-February 07 Member No.: 38,519 |
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: CODE #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 trap17 (t3jem.trap17.com). Any help is appreciated, thanks in advance! |
|
|
|
Mar 7 2008, 02:35 AM
Post
#2
|
|
|
|||[ n00b King ]||| ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 591 Joined: 20-June 07 From: Auckland Member No.: 45,102 |
I dont think trap17 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.
|
|
|
|
Mar 7 2008, 03:25 AM
Post
#3
|
|
|
A computer once beat me at chess, but it was no match for me at kick boxing. ![]() Group: [MODERATOR] Posts: 3,744 Joined: 24-July 05 From: In Trouble Again... still? Member No.: 9,787 ![]() |
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 Trap17 Mysql Server from your own Desktop Command Prompt or from your school.
The Mysql server is only available via your Trap17 Hosting Account Cpanel, or a script in one of your files on your account. |
|
|
|
Mar 7 2008, 04:25 AM
Post
#4
|
|
|
Privileged Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 506 Joined: 9-February 07 Member No.: 38,519 |
Alright, thank you very much, at least I know what's wrong now. I will try and figure something out then. Thanks again!
|
|
|
|
Apr 18 2008, 09:39 PM
Post
#5
|
|
|
Newbie [Level 2] ![]() ![]() Group: [HOSTED] Posts: 29 Joined: 17-April 08 Member No.: 60,935 |
im not sure i think it only alows sub mysql witch is easy to do
1. 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 |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 13th May 2008 - 08:31 PM |