How to bind data using C++ and MySQL?
Posted by: Mapsi Keith
Date: March 08, 2011 07:52AM

Hi, I'd like to know what would be an efficient method for me to copy data from the MySQL DB to my C++ application. I need a method that will retrieve type information from each of the DB's fields, so that I can arrange them correctly, int with int, double with double, string with string and thus feed the data into my classes. I can already connect to the DB and even make queries, but I think the queries return strings or chars and I was wondering if I'd have to create algorithms to convert the queries into appropriate formats or if there is an easier way.
Here's the code, it's very short and hosted on codepad:

I have no clue as how to convert the query result into int's, char's, double's, etc...

Any help is greatly appreciated!
Thanks in advance!

Options: ReplyQuote

Written By
How to bind data using C++ and MySQL?
March 08, 2011 07:52AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.