create_table_php1.htm
Scripts:

<?php
$host = "localhost";
$user = "manas237";
$pass = "pwmanas237";
$db = "pgsdemo1";
// open a connection to the database server
$db = pg_connect ("host=$host dbname=$db user=$user password=$pass");
if(!$db){
echo "Error : Unable to open database\n";
} else {
echo "Opened database successfully\n";
}
echo "Creating table <br/>";
$sql =<<<EOF
CREATE TABLE emp2
(
eid integer NOT NULL,
fname text NOT NULL,
lname text NOT NULL,
age integer NOT NULL,
address character(50),
salary real,
CONSTRAINT emp2_pkey PRIMARY KEY (eid)
);
EOF;

$ret = pg_query($db, $sql);
if(!$ret){
echo pg_last_error($db);
} else {
echo "Table created successfully\n";
}
echo"table created" ;
pg_close($db);
?>

Refresh pgsAdminIII and you will note the table emp2  created

 

Now run emp2 over the internet

Note emp2 table is created