mysql-insertinto语句可执行不报错就是添不进去。请大神帮忙解答
来源:懂视网
责编:小采
时间:2020-11-09 16:50:46
mysql-insertinto语句可执行不报错就是添不进去。请大神帮忙解答
mysql-insertinto语句可执行不报错就是添不进去。请大神帮忙解答:mysqlmfc数据库 MYSQL m_sqlCon; mysql_init(&m_sqlCon); if(!mysql_real_connect(&m_sqlCon,localhost,root,0412qwer,xscj,3306,NULL,0)) {AfxMessageBox(_T(数据库连接失败));} else {Afx
导读mysql-insertinto语句可执行不报错就是添不进去。请大神帮忙解答:mysqlmfc数据库 MYSQL m_sqlCon; mysql_init(&m_sqlCon); if(!mysql_real_connect(&m_sqlCon,localhost,root,0412qwer,xscj,3306,NULL,0)) {AfxMessageBox(_T(数据库连接失败));} else {Afx
mysqlmfc数据库
MYSQL m_sqlCon;
mysql_init(&m_sqlCon);
if(!mysql_real_connect(&m_sqlCon,"localhost","root","0412qwer","xscj",3306,NULL,0))
{AfxMessageBox(_T("数据库连接失败"));}
else
{AfxMessageBox(_T("数据库连接成功"));}
string sqlstr; string str1("sas"); string str2("dfsd"); int result; sqlstr="insert into xs(XH,XM) values('"+str1+"','"+str2+"')"; result=mysql_query(&m_sqlCon,sqlstr.c_str()); if(0!=result) mysql_close(&m_sqlCon);
声明:本网页内容旨在传播知识,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。TEL:177 7030 7066 E-MAIL:11247931@qq.com
mysql-insertinto语句可执行不报错就是添不进去。请大神帮忙解答
mysql-insertinto语句可执行不报错就是添不进去。请大神帮忙解答:mysqlmfc数据库 MYSQL m_sqlCon; mysql_init(&m_sqlCon); if(!mysql_real_connect(&m_sqlCon,localhost,root,0412qwer,xscj,3306,NULL,0)) {AfxMessageBox(_T(数据库连接失败));} else {Afx