本文整理汇总了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);
}