��ѯ������
| 5 | |
| 6 | // ��ѯ������ |
| 7 | static int tbl_select(acl::db_handle& db) |
| 8 | { |
| 9 | const char* sql = "select value, category, type from black_white_list"; |
| 10 | |
| 11 | if (db.sql_select(sql) == false) |
| 12 | { |
| 13 | printf("select sql error\r\n"); |
| 14 | return (-1); |
| 15 | } |
| 16 | |
| 17 | printf("\r\n---------------------------------------------------\r\n"); |
| 18 | |
| 19 | const acl::db_rows* result = db.get_result(); |
| 20 | if (result) |
| 21 | { |
| 22 | const std::vector<acl::db_row*>& rows = result->get_rows(); |
| 23 | for (size_t i = 0; i < rows.size(); i++) |
| 24 | { |
| 25 | const acl::db_row* row = rows[i]; |
| 26 | for (size_t j = 0; j < row->length(); j++) |
| 27 | printf("%s, ", (*row)[j]); |
| 28 | printf("\r\n"); |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | int ret = (int) db.length(); |
| 33 | |
| 34 | // �ͷŲ�ѯ��� |
| 35 | db.free_result(); |
| 36 | return (ret); |
| 37 | } |
| 38 | |
| 39 | int main(void) |
| 40 | { |
no test coverage detected
searching dependent graphs…