Use table name variable.
$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
{
@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 {
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");