Click here to Skip to main content
16,006,378 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: how to add,modify and delete data from mysql server. Help me!!! Pin
Anonymous2-Jun-03 4:46
Anonymous2-Jun-03 4:46 
AnswerRe: how to add,modify and delete data from mysql server. Help me!!! Pin
siong2-Jun-03 7:16
siong2-Jun-03 7:16 
GeneralRe: how to add,modify and delete data from mysql server. Help me!!! Pin
Anonymous2-Jun-03 7:44
Anonymous2-Jun-03 7:44 
AnswerRe: how to add,modify and delete data from mysql server. Help me!!! Pin
siong2-Jun-03 8:08
siong2-Jun-03 8:08 
GeneralRe: how to add,modify and delete data from mysql server. Help me!!! Pin
Anonymous2-Jun-03 9:21
Anonymous2-Jun-03 9:21 
AnswerRe: how to add,modify and delete data from mysql server. Help me!!! Pin
siong2-Jun-03 17:16
siong2-Jun-03 17:16 
GeneralRe: how to add,modify and delete data from mysql server. Help me!!! Pin
Anonymous3-Jun-03 4:49
Anonymous3-Jun-03 4:49 
GeneralRe: how to add,modify and delete data from mysql server. Help me!!! Pin
siong here3-Jun-03 5:10
susssiong here3-Jun-03 5:10 
There still got error. Is that my code below got problem?

#define table "paises"
// TODO: Add your control notification handler code here
char sql[4000];


//m_cboPais.GetLBText(m_cboPais.GetCurSel(),d);


MYSQL mysql;
//MYSQL *connection;
CString str;
GetDlgItem(IDC_COMBO1)->GetWindowText(str);


char * test;
test=str.GetBuffer(str.GetLength());

mysql_init(&mysql);
mysql_options(&mysql,MYSQL_READ_DEFAULT_GROUP,"your_prog_name");
mysql_real_connect(&mysql,"localhost", "admin", "123", "test", 0, NULL, 0);

//sprintf(sql,"INSERT INTO %s VALUES ('auto',\test,'','te')",table); //e.g. i don't know your database
//modify ist with UPDATE and delete ist with DELETE FROM look api
sprintf(sql,"INSERT INTO %s table (CodPais,Nombre,Prefijo,Code) VALUES ('auto','%s','','te')",table, test.GetBuffer(getLength()) );
mysql_query(&mysql, sql);

//add ist with insert into table values

mysql_close(&mysql);


MessageBox("Data telah ditambah");

Error statement:

C:\Documents and Settings\lau\Desktop\myfuture\mysql++\DlgMySql2\DlgMySqlDlg.cpp(215) : error C2228: left of '.GetBuffer' must have class/struct/union type
C:\Documents and Settings\lau\Desktop\myfuture\mysql++\DlgMySql2\DlgMySqlDlg.cpp(215) : error C2065: 'getLength' : undeclared identifier
Error executing cl.exe.
GeneralRe: how to add,modify and delete data from mysql server. Help me!!! Pin
Anonymous3-Jun-03 6:14
Anonymous3-Jun-03 6:14 
Generalwhy "CStatusBar GetStatusBar(){ return m_wndStatusBar; }" cause problem Pin
yccheok1-Jun-03 5:27
yccheok1-Jun-03 5:27 
GeneralRe: why "CStatusBar GetStatusBar(){ return m_wndStatusBar; }" cause problem Pin
Dominik Reichl1-Jun-03 9:32
Dominik Reichl1-Jun-03 9:32 
Generalcompilation problem (use of undefined type 'CFaceDlg') while using class keyword to do forward declaration Pin
yccheok1-Jun-03 5:25
yccheok1-Jun-03 5:25 
GeneralRe: compilation problem (use of undefined type 'CFaceDlg') while using class keyword to do forward declaration Pin
Ken Mazaika1-Jun-03 7:11
Ken Mazaika1-Jun-03 7:11 
GeneralRe: compilation problem (use of undefined type 'CFaceDlg') while using class keyword to do forward declaration Pin
Dominik Reichl1-Jun-03 9:35
Dominik Reichl1-Jun-03 9:35 
GeneralCToolbar - LoadBitmap method Pin
Florin Ochiana1-Jun-03 4:01
Florin Ochiana1-Jun-03 4:01 
GeneralAbout Muti Thread, who can tell me what's wrong, thanks Pin
cjzdq31-May-03 23:38
cjzdq31-May-03 23:38 
GeneralRe: About Muti Thread, who can tell me what's wrong, thanks Pin
geo_m1-Jun-03 0:11
geo_m1-Jun-03 0:11 
GeneralRe: About Muti Thread, who can tell me what's wrong, thanks Pin
cjzdq1-Jun-03 0:38
cjzdq1-Jun-03 0:38 
GeneralRe: About Muti Thread, who can tell me what's wrong, thanks Pin
geo_m1-Jun-03 0:58
geo_m1-Jun-03 0:58 
GeneralRe: About Muti Thread, who can tell me what's wrong, thanks Pin
valikac1-Jun-03 6:22
valikac1-Jun-03 6:22 
GeneralRe: About Muti Thread, who can tell me what's wrong, thanks Pin
cjzdq2-Jun-03 1:09
cjzdq2-Jun-03 1:09 
GeneralRe: About Muti Thread, who can tell me what's wrong, thanks Pin
cjzdq2-Jun-03 1:14
cjzdq2-Jun-03 1:14 
GeneralI want to draw on a control,but the Dialog app will draw it automatic! Pin
white jungle31-May-03 20:10
white jungle31-May-03 20:10 
GeneralRe: I want to draw on a control,but the Dialog app will draw it automatic! Pin
Ted Ferenc31-May-03 21:42
Ted Ferenc31-May-03 21:42 
GeneralRe: I want to draw on a control,but the Dialog app will draw it automatic! Pin
white jungle31-May-03 23:41
white jungle31-May-03 23:41 

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.