From: Marcus Boerger Date: Wed, 21 Sep 2005 18:49:37 +0000 (+0000) Subject: - MFB X-Git-Tag: RELEASE_0_9_0~150 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d9ed9945cbe13723e43e19dcfca81aa35e19e4a4;p=php - MFB --- diff --git a/ext/pdo/tests/pdo_001.phpt b/ext/pdo/tests/pdo_001.phpt index a3fca65406..5129a17cec 100644 --- a/ext/pdo/tests/pdo_001.phpt +++ b/ext/pdo/tests/pdo_001.phpt @@ -10,6 +10,7 @@ PDOTest::skip(); ?> --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- getAttribute(PDO::ATTR_DRIVER_NAME) == 'mysql') { ?> --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- --FILE-- +--FILE-- +exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY, val1 VARCHAR(10), val2 VARCHAR(10), val3 VARCHAR(10))'); +$stmt = $db->prepare('INSERT INTO test values (1, ?, ?, ?)'); + +$data = array("one", "two", "three"); + +foreach ($data as $i => $v) { + $stmt->bindValue($i+1, $v); +} +$stmt->execute(); + +$stmt = $db->prepare('SELECT * from test'); +$stmt->execute(); + +var_dump($stmt->fetchAll(PDO::FETCH_ASSOC)); +?> +--EXPECT-- +array(1) { + [0]=> + array(4) { + ["id"]=> + string(1) "1" + ["val1"]=> + string(3) "one" + ["val2"]=> + string(3) "two" + ["val3"]=> + string(5) "three" + } +} diff --git a/ext/pdo/tests/pdo_test.inc b/ext/pdo/tests/pdo_test.inc index 79df2baa29..94fa9fbbfa 100644 --- a/ext/pdo/tests/pdo_test.inc +++ b/ext/pdo/tests/pdo_test.inc @@ -1,6 +1,21 @@ $v) putenv("$n=$v"); +} + class PDOTest { // create an instance of the PDO driver, based on // the current environment diff --git a/ext/pdo/tests/pecl_bug_5217.phpt b/ext/pdo/tests/pecl_bug_5217.phpt index 75df91956f..46e923ca9a 100644 --- a/ext/pdo/tests/pecl_bug_5217.phpt +++ b/ext/pdo/tests/pecl_bug_5217.phpt @@ -10,6 +10,7 @@ PDOTest::skip(); ?> --FILE--