Busybox: Upgrade to 1.21.1 (stable). lsof active.
[tomato.git] / release / src / router / php / ext / sybase_ct / tests / test_fields.phpt
blob46e932b85d50f4f4b85a538a7024b3934ad084d0
1 --TEST--
2 Sybase-CT sybase_field_* functions
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  */
12   require('test.inc');
14   $db= sybase_connect_ex();
16   // Issue a query
17   $q= sybase_unbuffered_query('select
18     1 as "id",
19     "Hello" as "caption",
20     "timm" as "author",
21     getdate() as "lastchange"
22   ', $db, FALSE);
23   var_dump($q);
25   var_dump(sybase_num_fields($q));
27   // Go through each field, dumping it
28   while ($field= sybase_fetch_field($q)) {
29     var_export($field); echo "\n";
30   }
31   
32   // Seek to the second field and fetch it
33  var_dump(sybase_field_seek($q, 1));
34  var_export(sybase_fetch_field($q)); echo "\n";
36  sybase_close($db);
38 --EXPECTF--
39 resource(%d) of type (sybase-ct result)
40 int(4)
41 stdClass::__set_state(array(
42    'name' => 'id',
43    'max_length' => 11,
44    'column_source' => '',
45    'numeric' => 1,
46    'type' => 'int',
48 stdClass::__set_state(array(
49    'name' => 'caption',
50    'max_length' => 5,
51    'column_source' => '',
52    'numeric' => 0,
53    'type' => 'string',
55 stdClass::__set_state(array(
56    'name' => 'author',
57    'max_length' => 4,
58    'column_source' => '',
59    'numeric' => 0,
60    'type' => 'string',
62 stdClass::__set_state(array(
63    'name' => 'lastchange',
64    'max_length' => 29,
65    'column_source' => '',
66    'numeric' => 0,
67    'type' => 'datetime',
69 bool(true)
70 stdClass::__set_state(array(
71    'name' => 'caption',
72    'max_length' => 5,
73    'column_source' => '',
74    'numeric' => 0,
75    'type' => 'string',