forked from kiseitai2/html2faxcover
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.cpp
More file actions
31 lines (26 loc) · 995 Bytes
/
test.cpp
File metadata and controls
31 lines (26 loc) · 995 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <iostream>
#include "mysql.h"
#include "data_base.h"
int main()
{
int res;
/*Database test*/
h2fax::cstr database = "avantfax_test\0";
h2fax::cstr host = "localhost\0";
h2fax::cstr password = "\0";//Add your own MySQL/WAMP/LAMP account info
h2fax::cstr username = "\0";
std::cout << "Connecting to database: " << database << " with username " << username << " and password:"
<< password << "." << std::endl;
MySQL db(database, username, password, host);
std::string query = db.prepareStatement("UserAccount", "email", "username='kiseitai2'","","",SELECT|WHERE);
std::cout << "Status: " << db.getStatus() << std::endl;
std::cout << "Query: " << query << std::endl;
std::string email;
std::cout << "Querying database!" << std::endl;
db.queryDB(query);
std::cout << "Obtaining results!" << std::endl;
db.getResult(email, 1);
std::cout << "Email: " << email << std::endl;
std::cin >> res;
return 0;
}