this is the first time for me to learn php and postgresql,i have some PC,one have a leagle ip,and the the name of this pc is
"XIN",the OS is redhat7.1,the following steps are:
1.use command setup as root,and choose postgresl,
2.create a database ,the name is "demo",and create table "news",and insert some values into the table;
3.create user nobody,grant the right of select to nobody for table;
4.us another pc and write a simple code of connect the DB,the code is "
<?
$conn=pg_pconnect("XIN","5432","nobody","","demo");
if($conn){
echo"?????????\n";
exit;
}
else {
echo"???\n";
}
?>
run under ie5,but now the errormessage is
"Warning: Unable to connect to PostgreSQL server: pqReadData() -- backend closed the channel unexpectedly. This probably means the backend terminated abnormally before or while processing the request. in /var/www/html/member/login.php on line 2
???
What's wrong,what shall do?
"XIN",the OS is redhat7.1,the following steps are:
1.use command setup as root,and choose postgresl,
2.create a database ,the name is "demo",and create table "news",and insert some values into the table;
3.create user nobody,grant the right of select to nobody for table;
4.us another pc and write a simple code of connect the DB,the code is "
<?
$conn=pg_pconnect("XIN","5432","nobody","","demo");
if($conn){
echo"?????????\n";
exit;
}
else {
echo"???\n";
}
?>
run under ie5,but now the errormessage is
"Warning: Unable to connect to PostgreSQL server: pqReadData() -- backend closed the channel unexpectedly. This probably means the backend terminated abnormally before or while processing the request. in /var/www/html/member/login.php on line 2
???
What's wrong,what shall do?