public function set($arrParams)
{
$strQuery = '';
$arrParams = $this->escapeParams($arrParams);
// INSERT
if (strncasecmp($this->strQuery, 'INSERT', 6) === 0) {
$strQuery = sprintf('(%s) VALUES (%s)', implode(', ', array_keys($arrParams)), str_replace('%', '%%', implode(', ', array_values($arrParams))));
} elseif (strncasecmp($this->strQuery, 'UPDATE', 6) === 0) {
$arrSet = array();
foreach ($arrParams as $k => $v) {
$arrSet[] = $k . '=' . $v;
}
$strQuery = 'SET ' . str_replace('%', '%%', implode(', ', $arrSet));
}
$this->strQuery = str_replace('%p', $strQuery, $this->strQuery);
return $this;
}