On Wed, Oct 17, 2012 at 6:07 PM, Larry Garfield <la...@garfieldtech.com> wrote:
> Nothing is wrong with mysqli per se.  It's up to date and secure, and
> certainly better than ext/mysql.  I recommend PDO over mysqli because:
> 1) PHP-engine-level global state (ie, not specifying a connection) is the
> source of most (although not quite all) evil.  Really, that way lies pain
> once you get into anything reasonably complicated and want to be able to
> test it properly.

I don't have a clue what you are saying here.

> 2) PDO is installed by default on virtually every PHP system in the world.
> ext/mysqli has never been part of the default build of PHP, and many to most
> web hosts don't have it installed.

Do you have any reasonable data on this? Where do you get this notion
that it's not installed on many to most web hosts? Every distro I've
encountered has it built in to the version installed (ubuntu, debian,
centos, fedora, os/x, gentoo, funtoo, and many i've forgotten).

You are correct that you must specify --with-mysqli in the configure
command if you build php from source.

> 3) mysqli's API is a bizarre hybrid of procedural and OO that confuses the
> heck out of me.  PDO's is far from perfect, but is more consistent and
> cleanly OO from the get-go.

Err...ah...err -- mysqli is not a hybrid. It offers both OO and
procedural, but you only use one or the other. If you mix them
together in the same script/app, you could be looking for a lot of

> I skipped mysqli entirely and went straight to PDO when it became available.

This might be the source of your bias.

That said, I use PDO now all the time.

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to