summaryrefslogtreecommitdiff
path: root/ext/pdo/tests/pdo_024.inc
diff options
context:
space:
mode:
Diffstat (limited to 'ext/pdo/tests/pdo_024.inc')
-rwxr-xr-xext/pdo/tests/pdo_024.inc21
1 files changed, 21 insertions, 0 deletions
diff --git a/ext/pdo/tests/pdo_024.inc b/ext/pdo/tests/pdo_024.inc
new file mode 100755
index 0000000000..60bb30a77c
--- /dev/null
+++ b/ext/pdo/tests/pdo_024.inc
@@ -0,0 +1,21 @@
+<?php # vim:ft=php
+
+require_once('pdo.inc');
+
+set_sql('create', 'create table test (id int, name varchar(10))');
+set_sql('insert', 'insert into test (id, name) values(0, :name)');
+set_sql('select', 'select name from test where id=0');
+
+$DB->query($SQL['create']);
+$stmt = $DB->prepare($SQL['insert']);
+$name = NULL;
+$before_bind = $name;
+$stmt->bindParam(':name', $name);
+if ($name !== $before_bind) {
+ echo "bind: fail\n";
+} else {
+ echo "bind: success\n";
+}
+var_dump($stmt->execute());
+var_dump($DB->query($SQL['select'])->fetchSingle());
+?>