本文整理匯總了C++中CreateTestTable函數的典型用法代碼示例。如果您正苦於以下問題:C++ CreateTestTable函數的具體用法?C++ CreateTestTable怎麽用?C++ CreateTestTable使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了CreateTestTable函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: f_mysql_connect
bool TestExtMysql::test_mysql_unbuffered_query() {
Variant conn = f_mysql_connect(TEST_HOSTNAME, TEST_USERNAME, TEST_PASSWORD);
VERIFY(CreateTestTable());
VS(f_mysql_query("insert into test (name) values ('test'),('test2')"), true);
Variant res = f_mysql_unbuffered_query("select * from test");
Variant row = f_mysql_fetch_assoc(res);
VS(f_print_r(row, true),
"Array\n"
"(\n"
" [id] => 1\n"
" [name] => test\n"
")\n");
row = f_mysql_fetch_assoc(res);
VS(f_print_r(row, true),
"Array\n"
"(\n"
" [id] => 2\n"
" [name] => test2\n"
")\n");
row = f_mysql_fetch_assoc(res);
VS(row, false);
return Count(true);
}
示例2: VERIFY
bool TestExtMysql::test_mysql_free_result() {
VERIFY(CreateTestTable());
VS(f_mysql_query("insert into test (name) values ('test'),('test2')"), true);
Variant res = f_mysql_query("select * from test");
VS(f_is_resource("result is a resource"), true);
f_mysql_free_result(res);
VS(f_is_resource("result is not a resource after being freed"), false);
VS(f_mysql_num_rows(res), false);
return Count(true);
}
示例3: f_mysql_connect
bool TestExtMysql::test_mysql_fetch_row() {
Variant conn = f_mysql_connect(TEST_HOSTNAME, TEST_USERNAME, TEST_PASSWORD);
VERIFY(CreateTestTable());
VS(f_mysql_query("insert into test (name) values ('test'),('test2')"), true);
Variant res = f_mysql_query("select * from test");
Variant row = f_mysql_fetch_row(res);
VS(HHVM_FN(print_r)(row, true),
"Array\n"
"(\n"
" [0] => 1\n"
" [1] => test\n"
")\n");
return Count(true);
}