25.2. MySQL C API
25.2.1. C API数据类型
25.2.2. C API函数概述
25.2.3. C API函数描述
25.2.4. C API预处理语句
25.2.5. C API预处理语句的数据类型
25.2.6. C API预处理语句函数概述
25.2.7. C API预处理语句函数描述
25.2.8. C API预处理语句方面的问题
25.2.9. 多查询执行的C API处理
25.2.10. 日期和时间值的C API处理
25.2.11. C API线程函数介绍
25.2.12. C API嵌入式服务器函数介绍
25.2.13. 使用C API时的常见问题
25.2.14. 创建客户端程序
25.2.15. 如何生成线程式客户端
///*****************************/ 生成数据,可忽略不看 /***************/ mysql_query(&mydata,"truncate table n_e_w;"); string sqlstr; sqlstr += "insert into n_e_w "; sqlstr += "set input=(SELECT c_name FROM concept ORDER BY RAND() LIMIT 1),"; sqlstr += "output=(SELECT c_name FROM concept ORDER BY RAND() LIMIT 1),"; sqlstr += "beforer=(SELECT c_name FROM concept ORDER BY RAND() LIMIT 1),"; sqlstr += "afterr=(SELECT c_name FROM concept ORDER BY RAND() LIMIT 1),"; sqlstr += "s_one=(SELECT s FROM s_table ORDER BY RAND() LIMIT 1),"; sqlstr += "s_two=(SELECT s FROM s_table ORDER BY RAND() LIMIT 1),"; sqlstr += "s_three=(SELECT s FROM s_table ORDER BY RAND() LIMIT 1);"; for(int t = 0; t < 30 ; t++)mysql_query(&mydata,sqlstr.c_str()); //******************************/ 获得数据,存到traindata /**************/ MYSQL_RES *result = NULL; mysql_query(&mydata,"SELECT * FROM n_e_w");
result = mysql_store_result(&mydata); //取得并打印行数 int rowcount = mysql_num_rows(result);