setAttribute(PDO::ATTR_EMULATE_PREPARES, $emu); $con->query('CREATE TABLE mik (v INTEGER NOT NULL, PRIMARY KEY(v))'); $t1 = time(); $stmt = $con->prepare('INSERT INTO mik(v) VALUES(:v)'); for($i = 0; $i < 10000; $i++) { $stmt->execute(array(':v' => $i)); } $t2 = time(); $con->query('DROP TABLE mik'); echo sprintf('%s (Prepared statement: %s): %d seconds', $lbl, $emu ? 'Emulate in driver' : 'Use database', $t2 - $t1) . "\r\n"; } function test($lbl, $constr, $usr, $pwd) { test_emu($lbl, $constr, $usr, $pwd, true); test_emu($lbl, $constr, $usr, $pwd, false); } test('MySQL', 'mysql:host=localhost;dbname=test', 'root', ''); test('SQLServer', 'sqlsrv:server=arnepc4;database=test', '', ''); test('PostgreSQL', 'pgsql:host=localhost;dbname=Test', 'postgres', 'xxxxxx'); ?>