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

« back to all changes in this revision

Viewing changes to ext/mysqli/tests/005.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 char/text long 
 
3
--SKIPIF--
 
4
<?php require_once('skipif.inc'); ?>
 
5
--FILE--
 
6
<?php
 
7
        include "connect.inc";
 
8
        
 
9
        /*** test mysqli_connect 127.0.0.1 ***/
 
10
        $link = mysqli_connect($host, $user, $passwd);
 
11
 
 
12
        mysqli_select_db($link, "test");
 
13
 
 
14
        mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch");
 
15
        mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 char(10), c2 text)");
 
16
 
 
17
        $a = str_repeat("A1", 32000);
 
18
 
 
19
        mysqli_query($link, "INSERT INTO test_bind_fetch VALUES ('1234567890', '$a')");
 
20
 
 
21
        $stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
 
22
        mysqli_bind_result($stmt, $c1, $c2);
 
23
        mysqli_execute($stmt);
 
24
        mysqli_fetch($stmt);
 
25
 
 
26
        $test[] = $c1;
 
27
        $test[] = ($a == $c2) ? "32K String ok" : "32K String failed";
 
28
 
 
29
        var_dump($test);
 
30
 
 
31
        mysqli_stmt_close($stmt);
 
32
        mysqli_close($link);
 
33
?>
 
34
--EXPECT--
 
35
array(2) {
 
36
  [0]=>
 
37
  string(10) "1234567890"
 
38
  [1]=>
 
39
  string(13) "32K String ok"
 
40
}