日期:2014-05-16 浏览次数:20659 次
<?php require_once './kernel/global.php'; $db = cmspad_database(); // 执行一条SQL语句 $db->query('SELECT * FROM hello'); // 批量执行SQL语句 $db->addBatch('UPDATE hello SET world = 1 WHERE id = 7'); $db->addBatch('UPDATE hello SET world = 2 WHERE id = 8'); $db->addBatch('UPDATE hello SET world = 3 WHERE id = 9'); $db->executeBatch(); // 预编译SQL语句 $stmt = $db->prepare('SELECT * FROM hello WHERE id = ?'); $stmt->setInteger(0, 7); $resultSet = $stmt->execute(); $stmt->close(); ?>