~ubuntu-branches/ubuntu/hardy/php5/hardy-updates

« back to all changes in this revision

Viewing changes to ext/mysqli/tests/012.phpt

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-10-09 03:14:32 UTC
  • Revision ID: james.westby@ubuntu.com-20051009031432-kspik3lobxstafv9
Tags: upstream-5.0.5
ImportĀ upstreamĀ versionĀ 5.0.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--TEST--
 
2
mysqli fetch mixed values 2
 
3
--INI--
 
4
precision=12
 
5
--SKIPIF--
 
6
<?php require_once('skipif.inc'); ?>
 
7
--FILE--
 
8
<?php
 
9
        include "connect.inc";
 
10
        
 
11
        /*** test mysqli_connect 127.0.0.1 ***/
 
12
        $link = mysqli_connect($host, $user, $passwd);
 
13
 
 
14
        mysqli_select_db($link, "test");
 
15
 
 
16
        mysqli_query($link,"DROP TABLE IF EXISTS test_bind_result");
 
17
 
 
18
        mysqli_query($link,"CREATE TABLE test_bind_result(c1 tinyint, c2 smallint, 
 
19
                                                        c3 int, c4 bigint, 
 
20
                                                        c5 float, c6 double,
 
21
                                                        c7 varbinary(10), 
 
22
                                                        c8 varchar(10))");
 
23
 
 
24
        mysqli_query($link,"INSERT INTO test_bind_result VALUES(120,2999,3999,54,
 
25
                                                              2.6,58.89,
 
26
                                                              '206','6.7')");
 
27
 
 
28
        $stmt = mysqli_prepare($link, "SELECT * FROM test_bind_result");
 
29
        mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8);
 
30
        mysqli_execute($stmt);
 
31
        mysqli_fetch($stmt);
 
32
 
 
33
        $test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7,$c8);
 
34
 
 
35
        var_dump($test);
 
36
 
 
37
        mysqli_stmt_close($stmt);
 
38
        mysqli_close($link);
 
39
?>
 
40
--EXPECT--
 
41
array(8) {
 
42
  [0]=>
 
43
  int(120)
 
44
  [1]=>
 
45
  int(2999)
 
46
  [2]=>
 
47
  int(3999)
 
48
  [3]=>
 
49
  int(54)
 
50
  [4]=>
 
51
  float(2.59999990463)
 
52
  [5]=>
 
53
  float(58.89)
 
54
  [6]=>
 
55
  string(3) "206"
 
56
  [7]=>
 
57
  string(3) "6.7"
 
58
}