PHP and Postgresql on Windows

Поиск
Список
Период
Сортировка
От typing80wpm@aol.com
Тема PHP and Postgresql on Windows
Дата
Msg-id 8C7158661C832F6-5CC-2E124@mblk-d48.sysops.aol.com
обсуждение исходный текст
Список pgsql-general
I searched on goolge and found my answer, I think.
 
From what I see (below), all I need to do is a WAMP install from one of the CDs in the back of the PHP books I bought, and then un-comment the extension=php_pgsql.dll
 
 
 
 
Connect to PostgreSQL from PHP
Open your php.ini file (most likely located in c:\winnt), find the section called Dynamic Extensions and un-comment the line that contains "extension=php_pgsql.dll". Save and close php.ini and restart Apache. If the Web server complains and says it's unable to load the dynamic library, you probably have entered the wrong path for extension_dir in php.ini (section Paths and Directories). Another possible -– though unlikely -- cause is that the file php_pgsql.dll isn't present in the extensions directory.
 
Now you should be able to run the following little PHP script:
 
<?
$conn = pg_connect("host=localhost 
   port=5432 
   dbname=template1 
   user=postgres 
   password=********");
$sql = "SELECT current_date AS today;";
$result = pg_query($conn, $sql);
$row = pg_fetch_object($result, 0);
echo "Today is: " .$row->today;
?>
 
 
The script isn't too exciting, but at least it shows you how to connect to the database and execute a query.
 

В списке pgsql-general по дате отправления:

Предыдущее
От: Sven Willenberger
Дата:
Сообщение: Re: plperl function fails to "fire" Slony trigger
Следующее
От: Tom Lane
Дата:
Сообщение: Re: libpq Unicode support?