Jump to content
  • Advertisement
Sign in to follow this  
  • entries
    32
  • comments
    30
  • views
    11038

So that wasn't hard.

Sign in to follow this  
Lacutis

131 views

I was pretty close on how the use of that MySQL wrapper would end up.

So I present, using my wrapper:


DBDef db;

db.m_host = "localhost";
db.m_user = "username";
db.m_pass = "password";
db.m_db = "mydb";

CMySQL Query(db);

Query.SetQuery("SELECT * FROM TEST");

if(Query.IsOpen())
{
while(!Query.IsEof())
{
cout << "Entity Id: \"" Query(0) << "\" Text: \"" << Query(1) << "\".\n";
Query.Next();
}
}
else
{
cout << "Query Error: " << Query.GetError();
exit(1);
}

system("PAUSE");




And the output:

connected...
Entity Id: "1" Text: "Test Line 1".
Entity Id: "2" Text: "Test Line 2".
Press any key to continue . . .



So I guess while I'm at work today I will map out how I want my entity tables to lay out, then when I get home I'll create all the tables and write the startup entity read in code.
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

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
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!