views:

13

answers:

1

I used to use PEAR MDB2 and one of the things I loved was the autoExecute()

It really cut down on code.

But's it's a pain having to get MDB2 enabled on some hosted servers. I'd like to use either PDO or just include some class file.

It looks like adodb has autoExecute too http://phplens.com/lens/adodb/docs-adodb.htm#autoexecute

Is there any wrapper out there that would let me do it with PDO or mysqli even? (because all my stuff is mysql specific anyway)

$table = 'user';
$data = array (
  'userid' => '3344',
  'name' => 'john blogg',
  'age' => '24',
  'sex' => 'male'
);
$result = $adodb->AutoExecute($table, $data, 'INSERT');
A: 

The beaty of PEAR is you can download all the files yourself, and put them in your own project tree. By all means, if there is no 'shared' PEAR location available, just provide your own.

Building it into your own PDO class would be quite trivial, look at the functions at http://phpxref.com/xref/pear/MDB2/Extended.php.source.html, they're pretty basic, you should be able to get some equivalent code in under 30 lines.

Wrikken