News Feed
Jobs Feed
Sections




News Archive
Lukas Smith's Blog:
MDB2 example
December 28, 2005 @ 06:35:15

Lukas Smith has an example of how to use his MDB2 package in one of his latest blog posts.

I just wanted to show case some of the new features in MDB2. I especially wanted to demo some PHP5 specific features. The following example just creates a table with an autoincrementing primary key column 'id', inserts some values, fetches the last inserted id and finally, after selecting those values and outputs them using an iterator, drops the table again...

The example should work with MySQL and PostgreSQL, but not with SQLite (due to a limitation in the SQLite API). The MDB2 library makes interfacing with the database nice and clean, using functions like prepare(), execute() and query() to do the hard work for you.

0 comments voice your opinion now!
mdb2 example create table insert fetch mdb2 example create table insert fetch


blog comments powered by Disqus

Similar Posts

Alison Lunde's Blog: Quick and Dirty PHP Caching

Padraic Brady's Blog: An Example Zend Framework Blog Application - Part 1: Introductory Planning

The Coders Lexicon: My Love / Hate Relationship With PHP Traits

Wez Furlong: OpenID (and TypeKey) using native OpenSSL functions in PHP

NETTUTS.com: Create a PHP5 Framework - Part 2


Community Events











Don't see your event here?
Let us know!


phpunit zendframework2 unittest database community code example framework testing api podcast series release language functional introduction interview development opinion composer

All content copyright, 2013 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework