Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
israel-nogueira committed Jun 26, 2023
1 parent acccf78 commit 37715c8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 17 deletions.
6 changes: 2 additions & 4 deletions src/actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ public function select($alias = null, $script = null){
| EXEC FUNCTION
|--------------------------------------------------------------------------
*/
public function execQuery($P_ALIAS='response'){
public function execQuery(){
if($this->transactionFn == true){
if($this->query==""){ return [];}

Expand All @@ -457,9 +457,7 @@ public function execQuery($P_ALIAS='response'){
throw new Exception($this->connection->errorInfo()[2]);
break;
}
if($this->stmt->rowCount()>0){
$this->startProcessResult($this->stmt,$query,$_ALIAS);
}
$this->startProcessResult($this->stmt,$query,$_ALIAS);
$this->stmt->closeCursor();
}

Expand Down
23 changes: 10 additions & 13 deletions src/queryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -564,20 +564,17 @@ public function on_duplicate(){
$keyvalue = array();
foreach ($this->InsertVars as $key => $value) {
if ($value=='NULL') {
$keyvalue[] = $key . 'NULL';
}elseif(is_string($value)) {
if (substr($value, 0, 8) == "command:") {$value = substr($value,8);}
$_verify = $this->functionVerifyArray($value);
if($_verify!==false){
$keyvalue[] = $key.'='.$_verify['function'].(($_verify['function']!="")?'('.$_verify['params'].')':"NULL");//$this->preventMySQLInject($value)
}else{
$keyvalue[] = '"' . $this->preventMySQLInject($value) . '"';
}


} else {
$keyvalue[] = $key . "=" . $this->preventMySQLInject($value);
$keyvalue[] = $key.'=NULL';
}elseif(is_string($value)) {
if (substr($value, 0, 8) == "command:") {
$value = substr($value,8);
$keyvalue[] = $key.'='.$this->preventMySQLInject($value);
} else{
$keyvalue[] = $key.'="'.$this->preventMySQLInject($value).'"';
}
} else {
$keyvalue[] = $key . "=" . $this->preventMySQLInject($value);
}
}
$this->on_duplicate = ' ON DUPLICATE KEY UPDATE ' . implode(',', $keyvalue);
return $this;
Expand Down

0 comments on commit 37715c8

Please sign in to comment.