vasinsky
public function update($database, $table, $setcolumn, $newvalue, $where)
{
$sql = "UPDATE `{$database}`.`{$table}` SET `{$setcolumn}` = :update_value_0 WHERE ";
$plaseholder_val = trim($newvalue) . ',' . $where;
$i = 1;
$where = explode(',', $where);
$pricolumns = $this->columns($database, $table, 'PRI');
if (!empty($pricolumns))
{
foreach ($pricolumns as $val)
{
$where[$i - 1] = "`" . $table . "`.`" . $val . "`=" . ":update_value_{$i}";
$i++;
}
$sql .= implode(' AND ', $where);
// echo $sql . "<br>";
return $this->Execute($sql, $this->execute_array(':update_value_', $plaseholder_val));
}
// $sql = "UPDATE `{$database}`.`{$table}` SET `{$setcolumn}` = :newvale WHERE `ts_empty`.`id` =13 AND `ts_empty`.`name` = 'A';";
// print_r($this->columns($database, $table));
//UPDATE `testloc_testdb`.`ts_empty` SET `name` = '00019A' WHERE `ts_empty`.`id` =13 AND `ts_empty`.`name` = 'CAFGGG';
}