summaryrefslogtreecommitdiff
path: root/ext/mysqli
diff options
context:
space:
mode:
authorGeorg Richter <georg@php.net>2003-02-16 12:04:21 +0000
committerGeorg Richter <georg@php.net>2003-02-16 12:04:21 +0000
commitffe43821d07a1036bd19f78e821b60a13b7da01b (patch)
tree82bd7fc045e8345caa6f3959604dfa2115fbbdf1 /ext/mysqli
parent6997d50ff0ca1314615573943e4b106446d05922 (diff)
downloadphp-git-ffe43821d07a1036bd19f78e821b60a13b7da01b.tar.gz
test for mysqli_stmt_affected_rows (delete command)
Diffstat (limited to 'ext/mysqli')
-rw-r--r--ext/mysqli/tests/046.phpt31
1 files changed, 31 insertions, 0 deletions
diff --git a/ext/mysqli/tests/046.phpt b/ext/mysqli/tests/046.phpt
new file mode 100644
index 0000000000..d4a93ca277
--- /dev/null
+++ b/ext/mysqli/tests/046.phpt
@@ -0,0 +1,31 @@
+--TEST--
+mysqli_stmt_affected_rows (delete)
+--FILE--
+<?php
+ include "connect.inc";
+
+ /*** test mysqli_connect 127.0.0.1 ***/
+ $link = mysqli_connect("localhost", $user, $passwd);
+
+ mysqli_select_db($link, "test");
+
+ mysqli_query($link, "DROP TABLE IF EXISTS test_affected");
+ mysqli_query($link, "CREATE TABLE test_affected (foo int)");
+
+ mysqli_query($link, "INSERT INTO test_affected VALUES (1),(2),(3),(4),(5)");
+
+ $stmt = mysqli_prepare($link, "DELETE FROM test_affected WHERE foo=?");
+ mysqli_bind_param($stmt, &$c1, MYSQLI_BIND_INT);
+
+ $c1 = 2;
+
+ mysqli_execute($stmt);
+ $x = mysqli_stmt_affected_rows($stmt);
+
+ mysqli_stmt_close($stmt);
+ var_dump($x==1);
+
+ mysqli_close($link);
+?>
+--EXPECT--
+bool(true)