Re: postgresql database access failure
| From: | Matt Graham | Date: | Mon, 02 May 2011 17:39:14 +0000 |
| Subject: | Re: postgresql database access failure | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-312631@lists.php.net to get a copy of this message | ||
Florin Jurcovici wrote:
> My personal recommendation, however, is to drop old-style procedural
> drivers and switch to PDO - it's much more convenient to use, IMO.
Just be careful. PDO's implementation of MySQL doesn't implement the
mysql_set_charset() function, or at least it didn't a while back according to
my reading the PDO source. Setting a charset in the DSN was possible, but PDO
didn't *do* anything with that setting. There are probably other minor holes
out there. ("Everything in these tables is UTF-8!" "Are you *sure* about
that? It looks a lot like CP-1252 here, and here, and here....")
> you use PDO, you don't need to study the API of various different DB
> drivers, and your code can easily switch from one database to another.
This is true to some extent. There are probably a few odd cases where the
native functions do more, or do it better than whatever the latest and
greatest layer of abstraction does.
--
Matt G / Dances With Crows
The Crow202 Blog: http://crow202.org/wordpress/
There is no Darkness in Eternity/But only Light too dim for us to see