- end: documentation ( source)
<?php
$this->queries .= 'UPDATE ' . $this->table . ' SET ';
foreach ($this->setAffectedCols as $cols) {
$this->queries .= (end($cols) === $cols) ? $cols . '=' . $this->data[ $cols ] . ';' : $cols . '=' . $this->data[ $cols ] . ', ';
$this->queries .= 'WHERE ' . $uniqueKey . '=' . $this->data[ $uniqueKey ];
}
$this->queries .= ';';
$this->counter++;