1--TEST--
2Sybase-CT query without storing
3--SKIPIF--
4<?php require('skipif.inc'); ?>
5--FILE--
6<?php
7/* This file is part of PHP test framework for ext/sybase_ct
8 *
9 * $Id$
10 */
11
12  require('test.inc');
13
14  $db= sybase_connect_ex();
15
16  // Create test table and insert some data
17  var_dump(sybase_query('
18    create table #test (
19      id numeric(10, 0) primary key not null,
20      caption varchar(255) not null,
21      author varchar(50) not null,
22      link varchar(255) null,
23      lastchange datetime default getdate() null
24    )
25  ', $db));
26  var_dump(sybase_query('insert into #test (
27      id, caption, author
28    ) values (
29      1, "Hello", "timm"
30    )
31  ', $db));
32  var_dump(sybase_query('insert into #test (
33      id, caption, author, link
34    ) values (
35      2, "World", "thekid", "http://thekid.de/"
36    )
37  ', $db));
38  var_dump(sybase_query('insert into #test (
39      id, caption, author
40    ) values (
41      3, "PHP", "friebe"
42    )
43  ', $db));
44
45  // Fetch data
46  $q= sybase_unbuffered_query('select * from #test order by id', $db, FALSE);
47  var_dump($q);
48  while ($row= sybase_fetch_assoc($q)) {
49    var_dump($row);
50  }
51
52  // Clean up and close connection
53  var_dump(sybase_query('drop table #test'));
54  sybase_close($db);
55?>
56--EXPECTF--
57bool(true)
58bool(true)
59bool(true)
60bool(true)
61resource(%d) of type (sybase-ct result)
62array(5) {
63  ["id"]=>
64  int(1)
65  ["caption"]=>
66  string(5) "Hello"
67  ["author"]=>
68  string(4) "timm"
69  ["link"]=>
70  NULL
71  ["lastchange"]=>
72  string(%d) "%s"
73}
74array(5) {
75  ["id"]=>
76  int(2)
77  ["caption"]=>
78  string(5) "World"
79  ["author"]=>
80  string(6) "thekid"
81  ["link"]=>
82  string(17) "http://thekid.de/"
83  ["lastchange"]=>
84  string(%d) "%s"
85}
86array(5) {
87  ["id"]=>
88  int(3)
89  ["caption"]=>
90  string(3) "PHP"
91  ["author"]=>
92  string(6) "friebe"
93  ["link"]=>
94  NULL
95  ["lastchange"]=>
96  string(%d) "%s"
97}
98bool(true)
99