So I've got a server host that runs my MySQL 5.1 db. I have a stored procedure in it, its similar to

CREATE PROCEDURE CountUsersByFirstName(IN SearchName TEXT, OUT Count INT)
BEGIN
SELECT COUNT(*) INTO Count FROM Users WHERE Name = SearchName;
END

the syntax of that may be off as i'm typing from memory, but I've tested the function from phpMyAdmin and it seems to work fine.

I have some software with a small user pool, maybe 50-100 people, written in c++ and I want it to be able to remotely access the database to pull information for the users to view. I've searched around and found some solutions in other languages, and some things that come close, but don't quite fulfill what I'm looking for.

Anyone have a quick and dirty example of how to do this?

Recommended Answers

All 2 Replies

Sorry for the long delay in answering, but you will most likely have to use ODBC. Just google for "ODBC C++ classes" and you will find some links. There is also an ODBC tutorial

For MySql, there is a MySQL++ tutorial

Thanks for the response, I did finally stumble onto that MySQL++ library yesterday. It's trying my patience but the multi line query stuff appears to be the answer.

Thanks.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.