1--TEST-- 2mysqli fetch tinyint values 3--EXTENSIONS-- 4mysqli 5--SKIPIF-- 6<?php 7require_once dirname(__DIR__) . "/test_setup/test_helpers.inc"; 8mysqli_check_skip_test(); 9?> 10--FILE-- 11<?php 12require_once dirname(__DIR__) . "/test_setup/test_helpers.inc"; 13 14 $link = default_mysqli_connect(); 15 16 // To get consistent result without depending on the DB version/setup 17 mysqli_query($link, "SET sql_mode=''"); 18 19 mysqli_query( 20 $link, 21 "CREATE TABLE test_bind_fetch_integers_tiny( 22 c1 tinyint, 23 c2 tinyint unsigned, 24 c3 tinyint not NULL, 25 c4 tinyint, 26 c5 tinyint, 27 c6 tinyint unsigned, 28 c7 tinyint 29 ) ENGINE=" . get_default_db_engine() 30 ); 31 32 mysqli_query($link, "INSERT INTO test_bind_fetch_integers_tiny VALUES (-23,300,0,-100,-127,+30,0)"); 33 34 $stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch_integers_tiny"); 35 mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7); 36 mysqli_stmt_execute($stmt); 37 mysqli_stmt_fetch($stmt); 38 39 $test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7); 40 41 var_dump($test); 42 43 mysqli_stmt_close($stmt); 44 mysqli_close($link); 45 print "done!"; 46?> 47--CLEAN-- 48<?php 49require_once dirname(__DIR__) . "/test_setup/test_helpers.inc"; 50tear_down_table_on_default_connection('test_bind_fetch_integers_tiny'); 51?> 52--EXPECT-- 53array(7) { 54 [0]=> 55 int(-23) 56 [1]=> 57 int(255) 58 [2]=> 59 int(0) 60 [3]=> 61 int(-100) 62 [4]=> 63 int(-127) 64 [5]=> 65 int(30) 66 [6]=> 67 int(0) 68} 69done! 70