Mysql 在命令行(cmd)和C++中获取表行数

命令行(cmd)中:

select count(1) from 表名;

或者

select count(*) from 表名;

C++中(已连接数据库的情况下):

MYSQL myCont;
res=mysql_store_result(&myCont);
int n=mysql_num_rows(res);

猜你喜欢

转载自blog.csdn.net/qq_41372644/article/details/123738885
今日推荐