Hi Sean,
Well, the db2 functions are purely SQL functions.  They are provided by 
IBM as part of the "ibm_db2" driver for PHP.  They can be used to access 
any DB2 database (not just the one on i).  Including DB2 for Linux or 
DB2 for Windows.  It also enables access to IBM Cloudscape or Apache 
Derby databases.
The server side of the DB2 driver is built-in to IBM i.
The PHP driver for ibm_db2 is free and available on all platforms. 
However, it has a dependency on additional IBM DB2 client software. 
This isn't a problem on i, since IBM provides that client software with 
the OS.  Zend provides the ibm_db2 driver with Zend Core, Zend Platform 
and Zend Server, and you've already got the DB2 client software on i, so 
you're all set.  If you install the open source version of PHP, you can 
install the ibm_db2 driver there as well.
However, if you decide to run your PHP on another platform (Linux, 
Windows, etc) and have it connect to your IBM i, then you'll need to get 
the DB2 client software for that platform. (IBM DB2 Universal Database 
client or IBM DB2 Connect).  And I don't think that stuff is available 
across all platforms (like FreeBSD)  It probably isn't free, either. 
(But I don't know the details.)
The i5 functions can do SQL, program calls, commands, native I/O, data 
queues, data areas, user spaces, spooled files, object lists, job lists 
and job logs.  (.. and I may have missed stuff ..).  They are part of a 
3rd party software package called 'EasyCom' from a company called "Aura 
Equipments" ( 
http://www.easycom-aura.com ).  Zend includes them with 
their PHP servers, and presumably pays Aura a license fee for that. 
You'll see a blurb about that in QSYSOPR after the software is loaded 
(typically, after an IPL).
When running the server-side of EasyCom runs in the ZEND subsystem and 
the job is named I5_COMD, the program name is EASYCOMD.
Since Zend includes the i5 functions with the i5 editions of Zend Core 
and Zend Platform (and presumably Zend Server as well) you'll have these 
functions on i.  Again, if you want to run your PHP on another platform 
to connect to the IBM i database, you'll probably have to purchase 
EasyCom for that other platform.  Likewise, if you want to run the open 
source PHP on i, you'll have to buy EasyCom.
The db2 drivers are much older.  At first, they supported a lot of 
functionality that i5 didn't support, however, the i5 drivers caught up. 
 As far as I know, the i5 drivers now support everything that the db2 
ones do.  (but I haven't gone over it with a fine-toothed comb)
I have no clue if there's a performance difference between them.  If 
there is, I haven't noticed it.
Porterfield, Sean wrote:
Specifically which I should use and why.  I posted here a while back
about getting started and got a reply that showed i5_ functions.  I
coded some pages with them that worked great.  Then later I heard
about db2_ functions.  Just wondering if I'm missing out on anything
other than portability which doesn't interest me.  (My data is on
System i; my php is on System i; no need to change that.)  I thought
I read somewhere about db2_ functions being more efficient, but that
could have been a rumor.  I don't get consistent times on my pages,
so a parallel test didn't seem worth the effort.
As an Amazon Associate we earn from qualifying purchases.