Click here to Skip to main content
14,298,939 members

MySQL C++ Wrapper

Rate this:
2.31 (58 votes)
Please Sign up or sign in to vote.
2.31 (58 votes)
4 May 2003
A set of C++ classes for working with the MySQL library.

Introduction

This is a simple C++ wrapper for working with MySQL... It requires the download of MySQL headers and lib (included with MySQL server here).

Sample

A simple example on how to use:

#include "mysqlplus.h"
#include <STDIO.H>
void main()
{
   sql_connection_c connection( "database", 
           "localhost", "root", "mypassword" );
   sql_query_c query( &connection );
   sql_result_c *sql_result = 0;
   if ( !query.execute( "select * from customers" ) )
   {
      printf( "oops... didn't execute!!\n" );
      return;
   }
   sql_result = query.store();
   int n_fields = sql_result->n_fields();
   for ( int idx = 0; idx < n_fields; idx++ )
   {
      sql_field_c sql_field = sql_result->fetch_field( idx );
      printf( "field %d [%s]\n", idx, sql_field.get_name() );
   }
}

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Goncalo Oliveira
Software Developer (Senior)
Portugal Portugal
No Biography provided

Comments and Discussions

 
Rant[My vote of 1] I don't think so. Pin
JohnWallis426-Jan-10 20:06
memberJohnWallis426-Jan-10 20:06 
GeneralHi Pin
caesten28-May-09 9:02
membercaesten28-May-09 9:02 
GeneralI am having "ISO C++ forbids declaration of `operator=' with no type " Pin
Mustafanabulsi12-Sep-08 22:07
memberMustafanabulsi12-Sep-08 22:07 
GeneralRe: I am having "ISO C++ forbids declaration of `operator=' with no type " [modified] Pin
Absalomx19-Apr-09 9:34
memberAbsalomx19-Apr-09 9:34 
Generalhelp with an clear example,, please Pin
jones16-Mar-08 19:17
memberjones16-Mar-08 19:17 
QuestionHow to find "mysql.h" Pin
divide_and_conquer14-Sep-07 4:38
memberdivide_and_conquer14-Sep-07 4:38 
AnswerRe: How to find "mysql.h" Pin
Maikel8320-Sep-07 23:34
memberMaikel8320-Sep-07 23:34 
QuestionCan not locate mysql.h in win32 distribution Pin
sansweb19-Jul-07 4:43
membersansweb19-Jul-07 4:43 
AnswerRe: Can not locate mysql.h in win32 distribution Pin
Ejdesgaard9-Aug-07 2:12
memberEjdesgaard9-Aug-07 2:12 
GeneralMySQL with TEXT type column Pin
AlexEvans6-Jul-07 12:56
memberAlexEvans6-Jul-07 12:56 
Generalmysql connection problem Pin
mongol khvv4-Jul-07 23:56
membermongol khvv4-Jul-07 23:56 
QuestionBug? Pin
schwarzi8118-Apr-07 23:29
memberschwarzi8118-Apr-07 23:29 
Questionhey hey hey What about *nix??? Pin
MaxJoa30-Jan-07 17:25
memberMaxJoa30-Jan-07 17:25 
QuestionHow to get row value? Pin
"kavin"21-Sep-06 0:48
member"kavin"21-Sep-06 0:48 
AnswerRe: How to get row value? Pin
crsreid26-Oct-07 23:00
membercrsreid26-Oct-07 23:00 
AnswerRe: How to get row value? Pin
crsreid27-Oct-07 0:38
membercrsreid27-Oct-07 0:38 
GeneralDon't work with MYSQL 5.0 Pin
CHEICKNA TRAORE20-Jul-06 4:01
memberCHEICKNA TRAORE20-Jul-06 4:01 
GeneralRe: Don't work with MYSQL 5.0 Pin
r4d4r29-Aug-06 4:53
memberr4d4r29-Aug-06 4:53 
GeneralWow! Pin
Rolando Cruz11-Jul-06 8:20
memberRolando Cruz11-Jul-06 8:20 
GeneralSome fixes Pin
Freelanc3r28-Jun-06 0:19
memberFreelanc3r28-Jun-06 0:19 
GeneralLinker Error Pin
A.T27-Jun-06 5:25
memberA.T27-Jun-06 5:25 
GeneralRe: Linker Error Pin
ruying19-May-08 17:02
memberruying19-May-08 17:02 
GeneralBorland C++ Builder 6.0 Pin
winsth10-May-06 0:13
memberwinsth10-May-06 0:13 
GeneralI Donnow .... Pin
SPrutnik1-Apr-06 22:08
memberSPrutnik1-Apr-06 22:08 
Generalnewbie - error C2065: 'mysql_connect' : Pin
doctorrie19-Mar-06 12:55
memberdoctorrie19-Mar-06 12:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Article
Posted 4 May 2003

Stats

232K views
3.9K downloads
50 bookmarked