Click here to Skip to main content
15,915,093 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralXML Parser Pin
elapid23-May-05 9:22
elapid23-May-05 9:22 
GeneralRe: XML Parser Pin
Christian Graus23-May-05 12:03
protectorChristian Graus23-May-05 12:03 
Generalglobal variables Pin
Anonymous23-May-05 8:18
Anonymous23-May-05 8:18 
GeneralRe: global variables Pin
David Crow23-May-05 9:02
David Crow23-May-05 9:02 
GeneralRe: global variables Pin
Jack Puppy23-May-05 10:07
Jack Puppy23-May-05 10:07 
GeneralRe: global variables Pin
Chris Losinger23-May-05 10:35
professionalChris Losinger23-May-05 10:35 
GeneralRe: global variables Pin
Anonymous24-May-05 5:26
Anonymous24-May-05 5:26 
GeneralMySQL Help Pin
talkster523-May-05 8:10
talkster523-May-05 8:10 
Hi,
I have been looking at connecting to MySQL databases for the past few hours and have it all working fine. However I am trying to retrieve information from my ini file that I have for my program and that works fine but when I try to put it into my MySQL Select command it causes an error and crashes the program. This is most likley a simple mistake on my behalf but could you please point me in the right direction. I am using the mysql++ library by the way. My code is as follows:

char szAuth[_MAX_PATH];
GetPrivateProfileString("Auth", "Key", "", szAuth, sizeof(szAuth),
"D:\\Programs\\Microsoft Visual Studio\\MyProjects\\Project12\\Debug\\IniDemo.ini");
std::cout << szAuth << "\n";

pConnection = mysql_init(NULL);
if(!pConnection) //error, quit the program
return 0;

printf("Attempting to connect\n");
if(mysql_real_connect(pConnection,"localhost","username","password","test",0,NULL,0) == NULL) //error, quit the program
return 0;

printf("Connected to the database\n");
mysql_query(pConnection,"SELECT * FROM auth WHERE auth=szAuth"); //query the database
pResult = mysql_store_result(pConnection);
printf("The Number of rows in the table: %d\n", mysql_num_rows(pResult));
mysql_free_result(pResult);

mysql_close(pConnection);
printf("Connection Terminated\n");
return 0;
GeneralRe: MySQL Help Pin
Christian Graus23-May-05 12:09
protectorChristian Graus23-May-05 12:09 
GeneralRe: MySQL Help Pin
talkster523-May-05 12:49
talkster523-May-05 12:49 
GeneralRe: MySQL Help Pin
Christian Graus23-May-05 13:17
protectorChristian Graus23-May-05 13:17 
GeneralRe: MySQL Help Pin
talkster523-May-05 22:19
talkster523-May-05 22:19 
GeneralRe: MySQL Help Pin
Christian Graus24-May-05 11:36
protectorChristian Graus24-May-05 11:36 
GeneralRe: MySQL Help Pin
talkster524-May-05 11:51
talkster524-May-05 11:51 
GeneralRe: MySQL Help Pin
Christian Graus24-May-05 14:08
protectorChristian Graus24-May-05 14:08 
GeneralRe: MySQL Help Pin
talkster524-May-05 20:06
talkster524-May-05 20:06 
GeneralPlease HELP with web service client Pin
ylaurasi23-May-05 7:40
ylaurasi23-May-05 7:40 
GeneralFile size limit Pin
Andrew Admire23-May-05 7:31
Andrew Admire23-May-05 7:31 
GeneralRe: File size limit Pin
David Crow23-May-05 7:43
David Crow23-May-05 7:43 
GeneralRe: File size limit Pin
Andrew Admire23-May-05 7:49
Andrew Admire23-May-05 7:49 
GeneralRe: File size limit Pin
David Crow23-May-05 8:01
David Crow23-May-05 8:01 
GeneralRe: File size limit Pin
Andrew Admire23-May-05 8:16
Andrew Admire23-May-05 8:16 
GeneralRe: File size limit Pin
David Crow23-May-05 8:59
David Crow23-May-05 8:59 
GeneralRe: File size limit Pin
Andrew Admire23-May-05 9:59
Andrew Admire23-May-05 9:59 
GeneralRe: File size limit Pin
David Crow23-May-05 10:01
David Crow23-May-05 10:01 

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.