Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

pg_close(3) [php man page]

PG_CLOSE(3)															       PG_CLOSE(3)

pg_close - Closes a PostgreSQL connection

SYNOPSIS
bool pg_close ([resource $connection]) DESCRIPTION
pg_close(3) closes the non-persistent connection to a PostgreSQL database associated with the given $connection resource. Note Using pg_close(3) is not usually necessary, as non-persistent open connections are automatically closed at the end of the script. If there is open large object resource on the connection, do not close the connection before closing all large object resources. PARAMETERS
o $connection - PostgreSQL database connection resource. When $connection is not present, the default connection is used. The default connection is the last connection made by pg_connect(3) or pg_pconnect(3). RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 pg_close(3) example <?php $dbconn = pg_connect("host=localhost port=5432 dbname=mary") or die("Could not connect"); echo "Connected successfully"; pg_close($dbconn); ?> The above example will output: Connected successfully SEE ALSO
pg_connect(3). PHP Documentation Group PG_CLOSE(3)

Check Out this Related Man Page

PG_HOST(3)																PG_HOST(3)

pg_host - Returns the host name associated with the connection

SYNOPSIS
string pg_host ([resource $connection]) DESCRIPTION
pg_host(3) returns the host name of the given PostgreSQL $connection resource is connected to. PARAMETERS
o $connection - PostgreSQL database connection resource. When $connection is not present, the default connection is used. The default connection is the last connection made by pg_connect(3) or pg_pconnect(3). RETURN VALUES
A string containing the name of the host the $connection is to, or FALSE on error. EXAMPLES
Example #1 pg_host(3) example <?php $pgsql_conn = pg_connect("dbname=mark host=localhost"); if ($pgsql_conn) { print "Successfully connected to: " . pg_host($pgsql_conn) . "<br/> "; } else { print pg_last_error($pgsql_conn); exit; } ?> SEE ALSO
pg_connect(3), pg_pconnect(3). PHP Documentation Group PG_HOST(3)
Man Page

15 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Could not open SCM connection

I am currently getting the following error on a solaris box : Could not open SCM connectionlaris box: Would someone be able to help me understand the error as I do not know what a SCM connection is. thanks Kristian (1 Reply)
Discussion started by: kristian
1 Replies

2. IP Networking

Unintentional connection!

I have been asking this question on several Mac community sites but never got a answer. I hope some of you UNIX gurus can provide me with the right kind of information :) Why is my system calling my router and how can I prevent it? I have a Power Mac QS 733 with MacOS 10.1.5 (as you already... (6 Replies)
Discussion started by: Corual Rex
6 Replies

3. HP-UX

Hung Port

Here's a difficult one for you. I am on HPUX 11.0. I have a hung port, it is stuck in FIN_WAIT_2. Short of rebooting, how can I terminate the connection the system thinks still exists? I found a script online that uses adb but have not been able to get it to work. I am still open to using... (6 Replies)
Discussion started by: TioTony
6 Replies

4. UNIX for Advanced & Expert Users

crontab-db connection prob

I have a shell script which contain database connection and runs a big query. When I run the script on command promp, the desired output is getting spooled taking some time. But when I setup a cronjob for that script, the spool file is not getting generated. What could be the problem? ... (3 Replies)
Discussion started by: nskworld
3 Replies

5. SuSE

net connection

i have installed suse linux 10 ,but i am not able to connect to the internet.i am learning unix now. i am new to this operating system. (2 Replies)
Discussion started by: viswareddy.32
2 Replies

6. HP-UX

ftp first connection closed

Hi, Have anyone seen this problem, there is one remote side where their ftp connection to our server will always fail with connection closed by remote host and the second connection will be working. is this an OS issue or network issue? Thanks Robert (4 Replies)
Discussion started by: robertngo
4 Replies

7. UNIX for Dummies Questions & Answers

Query :: Using Netstat finding total value to a db connection

I wrote a very simple script to calculate the DB connection from an appserver and check the total netstat connection to a particular DB exceed 25 then it will send mail netstat -a 2> /dev/null | awk '/.*ESTAB/{print $5}' | cut -d. -f1 | uniq -c | awk '{if ($1 > 25)print $2," exceed ",$1;}' ... (1 Reply)
Discussion started by: senthil.ak
1 Replies

8. Shell Programming and Scripting

Not able to catch psftp errors

Hi, While running the psftp with the below code,it is able to connect and open the ftp connection and closed the connection. But my scriptfile Test.ftp,is having the code "cd directoryname" where the directoryname does not exists. In this case i should be able to catch the error,instead it is... (1 Reply)
Discussion started by: nsrihari
1 Replies

9. Programming

how to obtain a persistent oracle connection in proc*c pthread

Hi all, I have problem to set up a persistent oracle connection in child thread. We have a massive batch process dealing with large data. Application was written and impossible to be rewritten. I am trying to extract the most time consuming data fetching and put it into a dedicated child... (3 Replies)
Discussion started by: ora-dev
3 Replies

10. HP-UX

Connection closed by foreign host

I am trying to connect to my HP server from remote machine. It gets connected but once credential are provided the connection is closed. adroit:/home/seo/hitendra 32 ] telnet myserv1 Trying... Connected to myserv1. Escape character is '^]'. Local flow control on Telnet TERMINAL-SPEED... (4 Replies)
Discussion started by: hiten.r.chauhan
4 Replies

11. UNIX for Dummies Questions & Answers

How to find Hung connection in UNix Systems ?

Hi Gurus , How to find Hung connection in Unix Systems I use ps -ef | grep "XXXX" it lists out some conections..How to know what is hung connection in there.. (3 Replies)
Discussion started by: Hyp_Todd
3 Replies

12. Solaris

network connection failing

hi, I'm setting up a home lab and I am having problems keeping my connection open on putty. every time i leave it for about 10 seconds and come back I keep having to re-connect. I'm more of a AIX person and trying to get more fimilar with Sun but some of the commands I am trying to run to diag... (2 Replies)
Discussion started by: vpundit
2 Replies

13. UNIX for Advanced & Expert Users

How keep running a program n an another computer via a connection ssh when the connection is closed?

Hi everybody, I am running a program on a supercomputer via my personal computer through a ssh connection. My program take more than a day to run, so when I left work with my PC I stop the connection with the supercomputer and the program stop. I am wondering if someone know how I can manage... (2 Replies)
Discussion started by: TomTomGre
2 Replies

14. UNIX for Beginners Questions & Answers

Print out my current http connection

Good evening Need you help please I just wanna to print out my current https connection and other users http connection which the application resides, for instance i connect to the below url to login into the application: https://serverappp01:14100/portal/Portal.html# In another session... (4 Replies)
Discussion started by: alexcol
4 Replies

15. UNIX for Beginners Questions & Answers

Telnet in script Connection closed by foreign host

Hello, I'm trying to learn and automate some tasks via a script, but my first ever script failed with "connection closed by foreign host" error. I checked the other discussions but it didn't help. Could you please help? #!/bin/bash ( sleep 2 echo open x.x.x.x 23 sleep 2 echo user sleep 2... (1 Reply)
Discussion started by: Myrtle
1 Replies