Esempio n. 1
0
bool TestExtMysql::test_mysql_num_rows() {
  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");
  VS(f_mysql_num_rows(res), 2);
  return Count(true);
}
Esempio n. 2
0
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);
}