我遇到麻烦,试图对插入函数进行编程 香港专业教育学院尝试了许多方法。这是我的代码
MYSQL* conn;
MYSQL_ROW row;
MYSQL_RES* res;
int nQueryState = 0;
int id = 1;
string szName;
string szDir;
string szPhone;
string szEmail;
cout << "Enter the Name: ";
cin >> szName;
cout << "Enter the adress: ";
cin >> szDir;
cout << "Enter the Phone: ";
cin >> szPhone;
mysql_real_connect(conn, "localhost", "user", "password", "db_metodologia", 3306, NULL, 0);
int ip = mysql_query(conn, "INSERT INTO tbl_paciente VALUES (What do i have to introduce here?)");
res = mysql_use_result(conn);
/* close connection */
mysql_free_result(res);
mysql_close(conn);
char ch; cout << endl << "Press Key: "; cin >> ch;
return;
如果您还有其他方法可以进行INSERT和DELETE语句,请告诉我。 我尝试以这种方式('“ + data +”')插入,但是我没有答案