~clinton-collins/familyproject/trunk

« back to all changes in this revision

Viewing changes to xampp/special/paradox/018.phpt

  • Committer: Clinton Collins
  • Date: 2009-06-26 19:54:58 UTC
  • Revision ID: clinton.collins@gmail.com-20090626195458-5ebba0qcvo15xlpy
Initial Import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--TEST--
 
2
Inserting records with memo fields
 
3
--SKIPIF--
 
4
<?php if (!extension_loaded("paradox")) print "skip"; ?>
 
5
--POST--
 
6
--GET--
 
7
--INI--
 
8
--FILE--
 
9
<?php 
 
10
$dirname = dirname($_SERVER["SCRIPT_FILENAME"]);
 
11
$fp = fopen($dirname."/px018.db", "w+");
 
12
$pxdoc = new paradox_db();
 
13
$fields = array(array("col1", "M", 20));
 
14
@$pxdoc->create_fp($fp, $fields);
 
15
$pxdoc->set_blob_file($dirname."/px018.mb");
 
16
$pxdoc->set_tablename("testtabelle");
 
17
$str1 = "Some text long enough to go into a blob file";
 
18
$str2 = "Too short";
 
19
for($i=0; $i<=3; $i++) {
 
20
        $pxdoc->insert_record(array($str1));
 
21
}
 
22
for($i=0; $i<=3; $i++) {
 
23
        $pxdoc->insert_record(array($str2));
 
24
}
 
25
for($i=0; $i<=3; $i++) {
 
26
        $pxdoc->insert_record(array(NULL));
 
27
}
 
28
print_r($pxdoc->retrieve_record(1));
 
29
print_r($pxdoc->retrieve_record(4));
 
30
$rec = $pxdoc->retrieve_record(9);
 
31
if(is_null($rec["col1"])) {
 
32
        echo "is null";
 
33
}
 
34
$pxdoc->close();
 
35
fclose($fp);
 
36
unlink($dirname."/px018.mb");
 
37
unlink($dirname."/px018.db");
 
38
?>
 
39
--EXPECT--
 
40
Array
 
41
(
 
42
    [col1] => Some text long enough to go into a blob file
 
43
)
 
44
Array
 
45
(
 
46
    [col1] => Too short
 
47
)
 
48
is null