Annotation of embedaddon/php/ext/mysqli/tests/059.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: sqlmode + bind
! 3: --SKIPIF--
! 4: <?php
! 5: require_once('skipif.inc');
! 6: require_once('skipifconnectfailure.inc');
! 7: ?>
! 8: --FILE--
! 9: <?php
! 10: require_once("connect.inc");
! 11:
! 12: /*** test mysqli_connect 127.0.0.1 ***/
! 13: $link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
! 14:
! 15: mysqli_select_db($link, $db);
! 16:
! 17: mysqli_query($link, "SET SQL_MODE='PIPES_AS_CONCAT'");
! 18:
! 19: mysqli_query($link,"DROP TABLE IF EXISTS mbind");
! 20: mysqli_query($link,"CREATE TABLE mbind (b varchar(25))");
! 21:
! 22: $stmt = mysqli_prepare($link, "INSERT INTO mbind VALUES (?||?)");
! 23:
! 24: mysqli_stmt_bind_param($stmt, "ss", $a, $b);
! 25:
! 26: $a = "foo";
! 27: $b = "bar";
! 28:
! 29: mysqli_stmt_execute($stmt);
! 30:
! 31: mysqli_stmt_close($stmt);
! 32:
! 33: $stmt = mysqli_prepare($link, "SELECT * FROM mbind");
! 34: mysqli_stmt_execute($stmt);
! 35:
! 36: mysqli_stmt_bind_result($stmt, $e);
! 37: mysqli_stmt_fetch($stmt);
! 38:
! 39: var_dump($e);
! 40:
! 41: mysqli_close($link);
! 42: print "done!";
! 43: ?>
! 44: --CLEAN--
! 45: <?php
! 46: require_once("connect.inc");
! 47: if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
! 48: printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
! 49:
! 50: if (!mysqli_query($link, "DROP TABLE IF EXISTS mbind"))
! 51: printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
! 52:
! 53: mysqli_close($link);
! 54: ?>
! 55: --EXPECTF--
! 56: %unicode|string%(6) "foobar"
! 57: done!
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>