foreach ( $a as &$row ) {
$this->insertOneRow( $table, $row, $fname );
}
- $retVal = true;
if ( in_array( 'IGNORE', $options ) ) {
$this->ignoreDupValOnIndex = false;
}
- return $retVal;
+ return true;
}
private function fieldBindStatement( $table, $col, &$val, $includeCol = false ) {
$this->ignoreDupValOnIndex = true;
}
- $retval = $this->query( $sql, $fname );
+ $this->query( $sql, $fname );
if ( in_array( 'IGNORE', $insertOptions ) ) {
$this->ignoreDupValOnIndex = false;
}
-
- return $retval;
}
public function upsert( $table, array $rows, array $uniqueIndexes, array $set,
$fname = __METHOD__
) {
- if ( !count( $rows ) ) {
+ if ( $rows === [] ) {
return true; // nothing to do
}
if ( $sl < 0 ) {
continue;
}
- if ( '-' == $line[0] && '-' == $line[1] ) {
+ if ( $line[0] == '-' && $line[1] == '-' ) {
continue;
}
$dollarquote = true;
}
} elseif ( !$dollarquote ) {
- if ( ';' == $line[$sl] && ( $sl < 2 || ';' != $line[$sl - 1] ) ) {
+ if ( $line[$sl] == ';' && ( $sl < 2 || $line[$sl - 1] != ';' ) ) {
$done = true;
$line = substr( $line, 0, $sl );
}
call_user_func( $resultCallback, $res, $this );
}
- if ( false === $res ) {
+ if ( $res === false ) {
$err = $this->lastError();
return "Query \"{$cmd}\" failed with error code \"$err\".\n";