// Collection of code snippets by Arne VajhÃ¸j 
// (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) 
#include <iostream>

using namespace std;

#include "mysqlobj.h"

int main()
{
    //
    // åben connection til:
    //   database = "Test"
    //   server = "localhost" (default)
    //   username = "root" (default)
    //   password = "" (default)
    //   port = 3306 (default)
    //
    Connection con("Test");
    if(!con.IsConnected())
    {
        cerr << con.GetError() << endl;
        exit(1);
    }
    // indsæt 10 rækker
    for(int i=0; i<10; i++)
    {
        con.ExecuteNonQuery("INSERT INTO t1 VALUES (%d,'%s')", i, "Dette er en test");
    }
    return 0;
}
