postgresql和php为什么无法连接

i want know how to call/connect postgresql data in php? because when i'm try to call it, in browser show this message error "Fatal error: Call to undefined function pg_connect() in C:\Program Files\xampp\htdocs\mydirectory\mymy\connectpg.php on line 2" . i'm using xampp 1.7.4 package and postgresql 9.2.6

You need to install php-pgsql package or if you are in windows you need to activate the extension with same name php-pgsql

To activate it (I see that you are using xampp) you should add in your php.ini file (placed in xampp\php) the following lines (or uncomment it):

extension=php_pgsql.dll
extension=php_pdo_pgsql.dll

Finally, you should restart the server

try adding

LoadFile "C:/yourphppath/libpq.dll"

to httpd.conf before loading php5 module