c语言如何调用Mysql数据库文件并进行对数据库的操作呢。
展开全部
MYSQL m_sqlCon;//声明
mysql_init(&m_sqlCon);//初始化
mysql_real_connect(&m_sqlCon, "127.0.0.1", abc, "root", "hibernate", atoi("3306"),NULL,0)//链接
mysql_query(&m_sqlCon, "SET NAMES GB2312"); //设置查询编码格式
res = mysql_query(&m_sqlCon,"select * from ms_sendlist where flag = 1 order by style desc");//查询
mysql_query(&m_sqlCon, sql);//插入,删除
mysql_init(&m_sqlCon);//初始化
mysql_real_connect(&m_sqlCon, "127.0.0.1", abc, "root", "hibernate", atoi("3306"),NULL,0)//链接
mysql_query(&m_sqlCon, "SET NAMES GB2312"); //设置查询编码格式
res = mysql_query(&m_sqlCon,"select * from ms_sendlist where flag = 1 order by style desc");//查询
mysql_query(&m_sqlCon, sql);//插入,删除
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询