Commit 83292e6c authored by Penny Leach's avatar Penny Leach
Browse files

added set_field_select

parent 3f135e1b
......@@ -671,8 +671,15 @@ function set_field($table, $newfield, $newvalue, $field1, $value1, $field2=null,
global $db;
$select = where_clause_prepared($field1, $field2, $field3);
$values = where_values_prepared($newvalue, $value1, $value2, $value3);
$values = where_values_prepared($value1, $value2, $value3);
return set_field_select($table, $newfield, $newvalue, $select, $values);
}
function set_field_select($table, $newfield, $newvalue, $select, $values) {
global $db;
$values = array_merge(array($newvalue), $values);
try {
$stmt = $db->Prepare('UPDATE '. get_config('dbprefix') . $table .' SET '. $newfield .' = ? ' . $select);
return $db->Execute($stmt, $values);
......@@ -680,6 +687,8 @@ function set_field($table, $newfield, $newvalue, $field1, $value1, $field2=null,
catch (ADODB_Exception $e) {
throw new SQLException($e->getMessage());
}
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment