���ӱ�����
| 38 | |
| 39 | // ���ӱ����� |
| 40 | static bool tbl_insert(acl::db_handle& db, int n) |
| 41 | { |
| 42 | const char* sql_fmt = "insert into group_tbl(group_name, uvip_tbl)" |
| 43 | " values('%s-%d', 'test')"; |
| 44 | |
| 45 | acl::string sql; |
| 46 | sql.format(sql_fmt, |
| 47 | acl::strconv(__pre, strlen(__pre), "gbk", "utf8").c_str(), n); |
| 48 | |
| 49 | if (db.sql_update(sql.c_str()) == false) { |
| 50 | return false; |
| 51 | } |
| 52 | |
| 53 | const acl::db_rows* result = db.get_result(); |
| 54 | if (result) { |
| 55 | const std::vector<acl::db_row*>& rows = result->get_rows(); |
| 56 | for (size_t i = 0; i < rows.size(); i++) { |
| 57 | const acl::db_row* row = rows[i]; |
| 58 | for (size_t j = 0; j < row->length(); j++) { |
| 59 | printf("%s, ", (*row)[j]); |
| 60 | } |
| 61 | printf("\r\n"); |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | db.free_result(); |
| 66 | return true; |
| 67 | } |
| 68 | |
| 69 | // ��ѯ������ |
| 70 | static int tbl_select(acl::db_handle& db, int n) |
no test coverage detected
searching dependent graphs…