Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Database With Mysql++, getting mySQL++ to work with trap17
t3jem
post 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!
Go to the top of the page
 
+Quote Post
sonesay
post 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.
Go to the top of the page
 
+Quote Post
jlhaslip
post 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 Icon

Group: [MODERATOR]
Posts: 3,744
Joined: 24-July 05
From: In Trouble Again... still?
Member No.: 9,787
Spam Patrol



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.
Go to the top of the page
 
+Quote Post
t3jem
post 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!
Go to the top of the page
 
+Quote Post
maplestory
post 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
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Installing Mysql On Unix, Linux(2)
  2. Connecting Php With Oracle Database(1)
  3. Joomla Sql Error: Connection To Database Server Failed.(1)
  4. Mysql Database Copying(4)
  5. Exporting Database Problems(3)
  6. How To Connect Site To Database? [resolved](12)
  7. Mysql And Sql(7)
  8. Questioning My Database Structure...(4)
  9. Loading File Into Blob Fields To Mysql(1)
  10. Mysql(7)
  11. Mysql Datatype Int() Question(1)
  12. Best Database Software?(1)
  13. Database Migration - Seditio To Joomla(1)
  14. Forum Database(9)
  15. Php With Simple Csv List As Database, What Do U Think?(2)
  1. Mysql Query Problems(6)
  2. What Value Would I Use To Insert This Data?(4)
  3. Mysql-essential-5.0.51 Installion Problem(1)
  4. The Best Free Php Mysql Blog(5)


 



- Lo-Fi Version Time is now: 13th May 2008 - 08:31 PM