News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

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

Manuel Pichler's Blog: Why I love PHP

Zend Developer Zone: Lifting the Skirt on Zend Framework 1.5 - Zend_Form

DevShed: Abstract Classes in PHP - Working with PHP 5

Luc de Brouwer's Blog: Never having to use $_GET or $_POST again

Benjamin Eberlei's Blog: Enums in PHP


Community Events





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


threedevsandamaybe interview introduction symfony2 podcast list release install series developer language testing code unittest opinion laravel community framework configure refactor

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