php-src/ext/pgsql/tests/01createdb.phpt

30 lines
491 B
Plaintext
Raw Normal View History

2001-12-17 00:16:48 +00:00
--TEST--
PostgreSQL create db
--SKIPIF--
<?php include("skipif.inc"); ?>
--FILE--
<?php
2003-05-20 00:14:46 +00:00
// create test table
include('config.inc');
$db = pg_connect($conn_str);
$res = @pg_query($db, "SELECT * FROM ".$table_name);
if (!@pg_num_rows($res))
2003-05-20 00:14:46 +00:00
{
@pg_query($db,$table_def); // Create table here
for ($i=0; $i < $num_test_record; $i++) {
pg_query($db,"INSERT INTO ".$table_name." VALUES ($i, 'ABC');");
}
}
else {
echo pg_last_error()."\n";
}
pg_close($db);
echo "OK";
2001-12-17 00:16:48 +00:00
?>
--EXPECT--
OK