mirror of
https://github.com/php/php-src.git
synced 2025-08-18 15:08:55 +02:00
test for mysqli_stmt_affected_rows (delete command)
This commit is contained in:
parent
6997d50ff0
commit
ffe43821d0
1 changed files with 31 additions and 0 deletions
31
ext/mysqli/tests/046.phpt
Normal file
31
ext/mysqli/tests/046.phpt
Normal file
|
@ -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)
|
Loading…
Add table
Add a link
Reference in a new issue