note 72336 added to ref.pdo-pgsql
| From: | amiller@php.net | Date: | Sun, 14 Jan 2007 20:12:02 +0000 |
| Subject: | note 72336 added to ref.pdo-pgsql | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-121643@lists.php.net to get a copy of this message | ||
If you want to use "Aliasing" in your code, that is to define the DSN string in the
php.ini file as described in the documentation for the constructor object for PDO itself (ex.)
try {
$dbh = new PDO("foo");
} catch(PDOException $e) {
echo $e->getMessage();
}
for the Aliasing to work, the DSN MUST be defined in the following way, following the syntax
exactly... that is with double quotes, the equal sign, etc. I dinked around with this for quite some
time before I figured this out. Again, that is no space between the dsn alias and the equals sign,
no space after the equals sign, double quotes around the DSN, not single quotes, and spaces in
between the attributes, not semicolons. I am not sure about whether you must also designate all the
connection attributes show here or not but this is what ultimately worked for me.
pdo.dsn.foo="pgsql:host=localhost port=5432 dbname=foodb user=foouser
password=foopassword"
----
Server IP: 64.71.164.2
Probable Submitter: 68.104.144.247
----
Manual Page -- http://www.php.net/manual/en/ref.pdo-pgsql.php
Edit -- https://master.php.net/note/edit/72336
Del: integrated -- https://master.php.net/note/delete/72336/integrated
Del: useless -- https://master.php.net/note/delete/72336/useless
Del: bad code -- https://master.php.net/note/delete/72336/bad+code
Del: spam -- https://master.php.net/note/delete/72336/spam
Del: non-english -- https://master.php.net/note/delete/72336/non-english
Del: in docs -- https://master.php.net/note/delete/72336/in+docs
Del: other reasons-- https://master.php.net/note/delete/72336
Reject -- https://master.php.net/note/reject/72336
Search -- https://master.php.net/manage/user-notes.php