I'm making a Mobile book inventory for a friends library,
It's using a mysql db so people can order a book online And pick it up later.
THE online part works great (my compliments to THE guys behind phpmyadmin).
However my problem is That THE offline Program Will need to connect to an db on THE librarys server (THE order-db syncs with THE website correctly).
And THE problem That i have is That i need to print THE content of THE db to THE screen so hè can sort THE books.
However i cant figure out how mysql connectors work,
I tried mysql++, mysql c++ connector, mysql c connector.
But not even THE simple samples, i understand.
THE db-table looks looks like this:
__________________________________
|title| date | lener |uitgeleend|
|book1|1/1/11|John doe| 0 |
|_____|______|________|___________|
And That is too what i want on screen.
I USe dev-c++.
And THE sql code i wanna USe is:
SELECT * FROM order WHERE uitgeleend = '0'
I would like a header in what i can do like:
int main()
{
cout << "loggin in...\n";
//sql is a class
sql sql;
sql.connect("123.34.567.89", "order", "root", "");
cout << "Getting data...\n";
sql::result result = sql.query("SELECT * FROM order WHERE uitgeleend = '0'");
cout << "| titel | datum | lener |\n";
for (int i = 0; result.rows > i; i++)
{
cout << "|" << result[i]["title"] << "|"
Well i think you can figure THE rest out yourself.
}
Sorry for my language but i am dutch And i send is from my iPhone.
Well
This is again like THE standard manual
I want to use 1 function to connect
then 1 function to execute THE query
And be Able to get a row like this:
result[<row>]["<column>"]
And get THE amount of rows like this:
int rows = result.length;
THE link is again to THE normal manual, those aren't easy And i can't figure out how it works
But thanks anyway
In reality you don't need to need to write a program yourself.
Just download MYSQL from their website (I think the opensource version is called community server or something like that) - and set it up
As well as the server, it also has a host of utility/admin commandline tools.
During the setup process just choose NOT to setup the server on your pc (unless you really want to).
Then use the mysql.exe utility to connect to your website and run your queries.
Good but...
1 i need to get the result back from the db
2 i cant ship a whole mysql db with my program
3 he wants me to also make a program for the customers so they can see their reservations
Your idea yust only works when using querys who doent return results