PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Database » DB » Bug #1117

autoExecuteMultiple

Details

Request #1117autoExecuteMultiple
Submitted2004-04-02 20:12 UTC
Frominfo at peter-thomassen dot de
Assigneddanielc
StatusWont fix
PackageDB
PHP VersionIrrelevant
Roadmaps(Not assigned)

Comments

[2004-04-02 20:12 UTC] info at peter-thomassen dot de

Description:
------------
I wish a function called autoExecuteMultiple() offering a simple way to do multiple INSERT resp. UPDATE operations.

Reproduce code:
---------------
<?php
// Once you have a valid DB object named $db...
$fields_values = array(
'id' => array(1, 2),
'name' => array('Fabien', 'Peter'),
'country' => array('France', 'Germany')
);
$table_name = 'user';
$db->autoExecuteMultiple($table_name, $fields_values, DB_AUTOQUERY_INSERT);
?>

Expected result:
----------------
autoExecute() shall be called for:

$fields_values1 = array(
'id' => 1,
'name' => 'Fabien',
'country' => 'France'
);
$fields_values2 = array(
'id' => 2,
'name' => 'Peter',
'country' => 'Germany'
);

Actual result:
--------------
Function is not available.

[2005-01-29 21:46 UTC] ruben at Lambda1 dot Be

How would you handle autoExecuteMultiple with UPDATE? We can't do this with a string as it would always update the same rows.

Make this function insert only? Or allow an array with WHERE conditions?

What are the developers standings about this?