]> granicus.if.org Git - php/commitdiff
Add bytea field to test table.
authorYasuo Ohgaki <yohgaki@php.net>
Fri, 5 Apr 2002 06:06:21 +0000 (06:06 +0000)
committerYasuo Ohgaki <yohgaki@php.net>
Fri, 5 Apr 2002 06:06:21 +0000 (06:06 +0000)
Use table name variable.

ext/pgsql/tests/config.inc
ext/pgsql/tests/createdb.inc
ext/pgsql/tests/large_object.inc

index a836d556dd050c5c7741a1f277783ea9ba921a84..2b5f05a71dab9a4e736b9b54f2f4ae6f42802a5f 100644 (file)
@@ -6,7 +6,7 @@ $conn_str = "host=localhost dbname=test";    // connection string
 $table_name = "php_pgsql_test";  // test table that should be exist
 $num_test_record = 1000;         // Number of records to create
 
-$table_def = "CREATE TABLE php_pgsql_test (num int, str text);"; // Test table 
+$table_def = "CREATE TABLE php_pgsql_test (num int, str text, bin bytea);"; // Test table 
 $field_name = "num";             // For pg_field_num()
 
 ?>
\ No newline at end of file
index ed425387fa279a281c1095050ee908d9cde528cf..28a04b702d5925f4895261d31d3d1105c2f832c4 100644 (file)
@@ -8,7 +8,7 @@ if (!@pg_num_rows(@pg_query($db, "SELECT * FROM ".$table_name)))
 {
        @pg_query($db,$table_def);
        for ($i=0; $i < $num_test_record; $i++) {
-               pg_query($db,"INSERT INTO php_pgsql_test VALUES ($i, 'ABC');");
+               pg_query($db,"INSERT INTO ".$table_name." VALUES ($i, 'ABC');");
        }
 }
 else {
index 2a1159c8c4c927c8be91b1a99dd4daa959c1108d..5ad84e2c4b34dee63ad19397bbb784f644dcfffa 100644 (file)
@@ -2,7 +2,7 @@
 
 include('config.inc');
 
-$db = pg_connect("host=localhost");
+$db = pg_connect($conn_str);
 pg_exec ($db, "begin");
 $oid = pg_lo_create ($db);
 if (!$oid) echo ("pg_lo_create() error\n");