Skip to content

Commit

Permalink
Merge branch 'w12_MDL-26842_20_ociparams' of git://github.com/skodak/…
Browse files Browse the repository at this point in the history
…moodle
  • Loading branch information
stronk7 committed Mar 21, 2011
2 parents c0c232a + 4c1638c commit 1997d9d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/dml/oci_native_moodle_database.php
Expand Up @@ -867,11 +867,12 @@ protected function bind_params($stmt, array $params=null, $tablename=null) {
} }
foreach($params as $key => $value) { foreach($params as $key => $value) {
// Decouple column name and param name as far as sometimes they aren't the same // Decouple column name and param name as far as sometimes they aren't the same
$columnname = $key; // Default columnname (for DB introspecting is key), but... if ($key == 'o_newfieldtoset') { // found case where column and key diverge, handle that
if ($key == 'newfieldtoset') { // found case where column and key diverge, handle that
$columnname = key($value); // columnname is the key of the array $columnname = key($value); // columnname is the key of the array
$params[$key] = $value[$columnname]; // set the proper value in the $params array and $params[$key] = $value[$columnname]; // set the proper value in the $params array and
$value = $value[$columnname]; // set the proper value in the $value variable $value = $value[$columnname]; // set the proper value in the $value variable
} else {
$columnname = preg_replace('/^o_/', '', $key); // Default columnname (for DB introspecting is key), but...
} }
// Continue processing // Continue processing
// Now, handle already detected LOBs // Now, handle already detected LOBs
Expand Down

0 comments on commit 1997d9d

Please sign in to comment.