vc++链接mysql数据库问题

有个问题不知道咋回事 我读取mysql数据库上的数据读取完了后程序会停止运行 刚学真不知道哪里错了百度了好一会没找到答案.\
大佬帮看下代码把 部分代码

//查询

MYSQL_RES *res ;
MYSQL_ROW row ;
MYSQL_FIELD *field;/*字段结构指针*/
int rw, column;
int i, j;
if (mysql_query(&mysql_data,"select * from qq1990086708"))
{
    MessageBox(L"查询失败!", L"");
    return;

}

//储存结果集
res = mysql_store_result(&mysql_data);

if (res)
{
    /*取得結果的行数和*/ 

    for (i = 1; i < rw + 1; i++)
    {
        row = mysql_fetch_row(res);

        for (j = 0; j < column;j++)
        {
            MessageBox(A2T(row[j]));
        }

        
    }
    
}
else MessageBox(L"储存结果集失败!", L"");



// 释放结果集
mysql_free_result(res);
//关闭mysql连接
mysql_close(&mysql_data);

就这里执行完就崩溃!

阅读 1.6k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题