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

« back to all changes in this revision

Viewing changes to ext/mysqli/tests/043.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_bind_param (UPDATE)
 
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_update");
 
15
        mysqli_query($link,"CREATE TABLE test_update(a varchar(10),
 
16
                                                     b int)");
 
17
 
 
18
        mysqli_query($link, "INSERT INTO test_update VALUES ('foo', 2)");
 
19
 
 
20
        $stmt = mysqli_prepare($link, "UPDATE test_update SET a=?,b=? WHERE b=?");
 
21
        mysqli_bind_param($stmt, "sii", $c1, $c2, $c3);
 
22
 
 
23
        $c1 = "Rasmus";
 
24
        $c2 = 1;
 
25
        $c3 = 2;
 
26
 
 
27
        mysqli_execute($stmt);
 
28
        mysqli_stmt_close($stmt);
 
29
 
 
30
        $result = mysqli_query($link, "SELECT concat(a, ' is No. ', b) FROM test_update");
 
31
        $test = mysqli_fetch_row($result);
 
32
        mysqli_free_result($result);
 
33
 
 
34
        var_dump($test);
 
35
 
 
36
        mysqli_close($link);
 
37
?>
 
38
--EXPECT--
 
39
array(1) {
 
40
  [0]=>
 
41
  string(15) "Rasmus is No. 1"
 
42
}