當前位置: 首頁>>代碼示例>>C++>>正文


C++ CreateTestTable函數代碼示例

本文整理匯總了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);
}
開發者ID:Ocramius,項目名稱:hiphop-php,代碼行數:26,代碼來源:test_ext_mysql.cpp

示例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);
}
開發者ID:AojiaoZero,項目名稱:hhvm,代碼行數:12,代碼來源:test_ext_mysql.cpp

示例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);
}
開發者ID:AojiaoZero,項目名稱:hhvm,代碼行數:15,代碼來源:test_ext_mysql.cpp


注:本文中的CreateTestTable函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。