|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-06-10 02:17 UTC] wez@php.net
[2005-10-23 09:26 UTC] mike@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 22:00:02 2025 UTC |
Description: ------------ Running php 5.0.4, pdo 0.3, pdo_pgsql 0.2, postgresql 8 I am used to using the user=x syntax in the connect string and was happy to see pdo support it. However I ran into a few problems when I wanted to include driver options. It seemed that pdo was adding an extra user= flag, causing postgresql to have a few problems and the connection to fail. I think an additional (connect string, options array) syntax would be great. Alternatively just check the string length. Reproduce code: --------------- $conn = new PDO("pgsql:dbname=benchmarking user=benchmarking"); $conn = new PDO("pgsql:dbname=benchmarking user=benchmarking", array(PDO_ATTR_PERSISTENT=>true)); $conn = new PDO("pgsql:dbname=benchmarking user=benchmarking",,, array(PDO_ATTR_PERSISTENT=>true)); $conn = new PDO("pgsql:dbname=benchmarking user=benchmarking", "", "", array(PDO_ATTR_PERSISTENT=>true)); $conn = new PDO("pgsql:dbname=benchmarking, "benchmarking", "", array(PDO_ATTR_PERSISTENT=>true)); Expected result: ---------------- I expected/hoped all of the above would give a sucessful connection. Actual result: -------------- works fails - wrong parameters fails - php error fails - postgresql error works