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 ..
I quickly hacked up this example after releasing MDB2 2.0.0RC2
and a number of driver updates. It should work fine with mysql
and pgsql. It will not work with sqlite, because automagically
determining the types from a result set is not supported by the
sqlite API. I have not tried another backend.
<?php
/**************************************/
/* a nice PHP5 only show case of MDB2 */
/**************************************/
require 'MDB2.php';
$dsn = array(
'phptype' => 'mysql',
'username' => 'root',
'password' => '',
'hostspec' => …
[Read more]