操作系统:Windows7(32位)
编译软件:Code::Blocks 10.05
数 据 库:mysql-5.1.62-win32
数据库内的数据:
测试代码:
#include
#include
#include
/*数据库连接用宏*/
#define HOST "localhost"
#define USERNAME "root"
#define PASSWORD "123456"
#define DATABASE "test"
int main()
{
char *query;
query="select * from t2";
query_sql(query);
return 0;
}
void query_sql(char* sql)
{
MYSQL my_connection; /*