本文整理汇总了PHP中MySQLPDOTest::dropTestTable方法的典型用法代码示例。如果您正苦于以下问题:PHP MySQLPDOTest::dropTestTable方法的具体用法?PHP MySQLPDOTest::dropTestTable怎么用?PHP MySQLPDOTest::dropTestTable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MySQLPDOTest
的用法示例。
在下文中一共展示了MySQLPDOTest::dropTestTable方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: pdo_mysql_stmt_bindparam_types
pdo_mysql_stmt_bindparam_types($db, 34, 'DATE', '2008-04-23');
pdo_mysql_stmt_bindparam_types($db, 35, 'TIME', '16:43:12');
pdo_mysql_stmt_bindparam_types($db, 36, 'TIMESTAMP', '2008-04-23 16:44:53');
pdo_mysql_stmt_bindparam_types($db, 37, 'DATETIME', '2008-04-23 16:44:53');
pdo_mysql_stmt_bindparam_types($db, 38, 'YEAR', '2008');
pdo_mysql_stmt_bindparam_types($db, 39, 'CHAR(1)', 'a');
pdo_mysql_stmt_bindparam_types($db, 40, 'CHAR(255)', 'abc');
pdo_mysql_stmt_bindparam_types($db, 41, 'VARCHAR(255)', str_repeat('a', 255));
pdo_mysql_stmt_bindparam_types($db, 42, 'BINARY(255)', str_repeat('a', 255));
pdo_mysql_stmt_bindparam_types($db, 43, 'VARBINARY(255)', str_repeat('a', 255));
pdo_mysql_stmt_bindparam_types($db, 44, 'TINYBLOB', str_repeat('a', 255));
pdo_mysql_stmt_bindparam_types($db, 45, 'BLOB', str_repeat('b', 300));
pdo_mysql_stmt_bindparam_types($db, 46, 'MEDIUMBLOB', str_repeat('b', 300));
pdo_mysql_stmt_bindparam_types($db, 47, 'LONGBLOB', str_repeat('b', 300));
pdo_mysql_stmt_bindparam_types($db, 48, 'TINYTEXT', str_repeat('c', 255));
pdo_mysql_stmt_bindparam_types($db, 49, 'TINYTEXT BINARY', str_repeat('c', 255));
pdo_mysql_stmt_bindparam_types($db, 50, 'TEXT', str_repeat('d', 300));
pdo_mysql_stmt_bindparam_types($db, 51, 'TEXT BINARY', str_repeat('d', 300));
pdo_mysql_stmt_bindparam_types($db, 52, 'MEDIUMTEXT', str_repeat('d', 300));
pdo_mysql_stmt_bindparam_types($db, 53, 'MEDIUMTEXT BINARY', str_repeat('d', 300));
pdo_mysql_stmt_bindparam_types($db, 54, 'LONGTEXT', str_repeat('d', 300));
pdo_mysql_stmt_bindparam_types($db, 55, 'LONGTEXT BINARY', str_repeat('d', 300));
pdo_mysql_stmt_bindparam_types($db, 56, "ENUM('yes', 'no') DEFAULT 'yes'", "no");
pdo_mysql_stmt_bindparam_types($db, 57, "SET('yes', 'no') DEFAULT 'yes'", "no");
} catch (PDOException $e) {
printf("[001] %s [%s] %s\n", $e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
print "done!";
require dirname(__FILE__) . '/mysql_pdo_test.inc';
MySQLPDOTest::dropTestTable();
示例2: printf
if (!isset($rows[0]['label']) || $rows[0]['label'] != 'z') {
printf("[006] Record data is strange, dumping rows\n");
var_dump($rows);
}
// Ok, lets check MyISAM resp. any other non-transactional engine
// pdo_mysql_begin_transaction has more on this, quick check only
$db = MySQLPDOTest::factory();
MySQLPDOTest::createTestTable($db, 'MyISAM');
if (true !== ($tmp = $db->beginTransaction())) {
printf("[007] Expecting true, got %s/%s\n", gettype($tmp), $tmp);
}
$db->exec("INSERT INTO test(id, label) VALUES (100, 'z')");
if (true !== ($tmp = $db->commit())) {
printf("[008] No commit allowed? [%s] %s\n", $db->errorCode(), implode(' ', $db->errorInfo()));
}
// a weak test without unicode etc. - lets leave that to dedicated tests
$stmt = $db->query('SELECT id, label FROM test WHERE id = 100');
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
if (!isset($rows[0]['label']) || $rows[0]['label'] != 'z') {
printf("[009] Record data is strange, dumping rows\n");
var_dump($rows);
}
} catch (PDOException $e) {
printf("[002] %s, [%s] %s\n", $e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
print "done!";
require dirname(__FILE__) . '/mysql_pdo_test.inc';
$db = MySQLPDOTest::factory();
$db->exec('DROP TABLE IF EXISTS test_commit');
MySQLPDOTest::dropTestTable($db);