PHP and PostgreSQL (
Page 1 of 9 )
When you talk about PHP and databases, people tend to assume
you're talking about MySQL. But hang on to your horses - difficult
though it may be to believe, PHP does include support for a number of
other databases. One of them is PostgreSQL, the *other* open-source
database - and this article tells you everything you need to know about
using it with PHP.There's something patently unfair going on here. For some reason, almost every
PHP tutorial on the planet makes the implicit assumption that if you're using
PHP with a database, that database is going to be MySQL.
Now, I have
absolutely nothing against MySQL - I think it's a great product, and I use it
fairly often in my development activities. However, it's not the only good
open-source RDBMS out there - most developers have been playing with PostgreSQL
for quite a while now, and quite a few of them would love to integrate their
PostgreSQL backend with PHP. The only problem is, they have no idea where to
start - the functions used to communicate with a PostgreSQL database are
different from those used in a MySQL environment, and the documentation out
there could do with some updating.
Well, it's time to bring some balance
back to the universe. Which is why this article looks at PHP from the PostgreSQL
developer's point of view, explaining how PHP can be used with the PostgreSQL
database system. If you're a MySQL user, you probably don't need to know any of
this; if you're a PostgreSQL fan, on the other hand, you can breathe a sigh of
relief and flip the page.