bind parameters

@param  \mysqli_stmt $stmt
@param  array $parameters
@return bool
@access protected
7400
protected function bindParameters(
        \mysqli_stmt $stmt,
        array $parameters
    )/*# : bool */ {
        $types = '';
        $args  = [];
        foreach ($parameters as $name => &$value) {
            $type = Types::guessType($value);
            switch ($type) {
                case Types::PARAM_INT:
                case Types::PARAM_BOOL:
                    $types .= 'i';
                    break;
                default:
                    $types .= 's';
                    break;
            }
            $args[] = &$value;
        }
        if (count($args)) {
            array_unshift($args, $types);
            return call_user_func_array([$stmt, 'bind_param'], $args);
        }
        return true;
    }
684792
protected function bindParams(PDOStatement &$stmt, array $values){
		$param_no = 1;

		foreach($values as $v){
			$t    = gettype($v);
			$type = PDO::PARAM_STR;

			if($t === 'boolean'){
				$type = PDO::PARAM_BOOL; // @codeCoverageIgnore
			}
			elseif($t === 'integer'){
				$type = PDO::PARAM_INT;
			}
			elseif($t === 'NULL'){
				$type = PDO::PARAM_NULL; // @codeCoverageIgnore
			}

			$stmt->bindValue($param_no, $v, $type);
			$param_no++;
		}
	}
424707
public function bindColumns(PdoStatement $stmt, array $columnAliases) {
		foreach ($columnAliases as $key => $columnAlias) {
			$this->values[$key] = null;
			$stmt->shareBindColumn($columnAlias, $this->values[$key]);
		}
	}
1020851
public function bind($name,$params) 
    {

        $this->instances[$name] = $params;
        $this->bind[$name] = true;

    }
357920
private function executeStatement($stmt) {

		if(true !== $stmt -> execute()) {

			if($this -> getLastErrno() > 0) {
				return trigger_error(sprintf('A database error occured with error number "%s" and message: "%s"', $this -> getLastErrno(), $this -> getLastError()), E_USER_ERROR);
			}

			return false;
		}

		$stmt -> store_result();

		return $stmt;
	}
554846
protected function insert(array $parameters)
    {
        $query = sprintf(
            "INSERT INTO `{$this->table}` (%s) VALUES (%s)",
            implode(', ', array_values($parameters['c'])),
            implode(', ', array_fill(0, count($parameters['c']), '?'))
        );

        $statement = $this->adapter->getDriver()->prepare($query);

        foreach ($parameters['c'] as $index => $name) {
            $statement->bind($index, $this->properties[$name]['value'], $this->properties[$name]['type']);
        }

        $statement->execute();

        $this->modified = null;
        $this->uid = $this->adapter->getDriver()->getLastInsertId();
    }
1141733
private function resolveMysqliPreparedStatement(mysqli_stmt $prepare, array $parameters = [])
    {
        $s = "";
        foreach ($parameters as $param) {

            if (is_string($param)) {
                $s .= "s";
            } elseif (is_integer($param)) {
                $s .= "i";
            }
        }

        if (count($parameters) < 1) {
            $paramArray = [];
        } else {
            $paramArray = array_merge([$s], $parameters);
        }

        call_user_func_array([$prepare, 'bind_param'], $this->refValues($paramArray));
        return $prepare->execute();
    }
830669
public function bind(array $param) {
		$ref    = new \ReflectionClass('mysqli_stmt');
		$method = $ref->getMethod("bind_param");
		$method->invokeArgs($this->result, $param);
	}
735229
public void bindDelete(PreparedStatement stmt, ClassDescriptor cld, Object obj) throws SQLException
    {
        if (cld.getDeleteProcedure() != null)
        {
            this.bindProcedure(stmt, cld, obj, cld.getDeleteProcedure());
        }
        else
        {
            int index = 1;
            ValueContainer[] values, currentLockingValues;

            currentLockingValues = cld.getCurrentLockingValues(obj);
            // parameters for WHERE-clause pk
            values = getKeyValues(m_broker, cld, obj);
            for (int i = 0; i < values.length; i++)
            {
                setObjectForStatement(stmt, index, values[i].getValue(), values[i].getJdbcType().getType());
                index++;
            }

            // parameters for WHERE-clause locking
            values = currentLockingValues;
            for (int i = 0; i < values.length; i++)
            {
                setObjectForStatement(stmt, index, values[i].getValue(), values[i].getJdbcType().getType());
                index++;
            }
        }
    }
188349
protected function bindValues($values) {
        if(is_array($values)) {
            foreach($values as $i => $value) {
                if(is_numeric($value) && intval($value) == $value && $value[0] != 0) {$type = PDO::PARAM_INT; $value = intval($value);}
                elseif(is_null($value) || $value === 'NULL') {$type = PDO::PARAM_NULL; $value = NULL;}
                elseif(is_bool($value)) {$type = PDO::PARAM_BOOL;}
                else{$type = PDO::PARAM_STR;}
                $this->query->bindValue(intval($i + 1), $value, $type);
            }
        }
    }
846837
public int bindValues(PreparedStatement stmt, ValueContainer[] values, int index) throws SQLException
    {
        if (values != null)
        {
            for (int i = 0; i < values.length; i++)
            {
                setObjectForStatement(stmt, index, values[i].getValue(), values[i].getJdbcType().getType());
                index++;
            }
        }
        return index;
    }
40934
public function multiBind(array $params = [])
    {
        foreach ($params as $parameter => $value) {
            $this->bindValue((is_numeric($parameter) ? $parameter + 1 : $parameter), $value, Connection::PARAM_STR);
        }
        
        return $this;
    }
22482
public function where($stmt)
    {
        if ($stmt instanceof Expression) {
            $this->where = $stmt;
        } elseif ($stmt instanceof \Closure) {
            $this->where = new Expression($this->getGrammar());
            call_user_func($stmt, $this->where);
        } elseif (is_array($stmt)) {
            $this->where = new Expression($this->getGrammar(), $stmt);
        } else {
            throw new \InvalidArgumentException('Where statement could to be Expression, callable or array');
        }

        return $this;
    }
813362
public function execBound(\PDOStatement $stmt, array $values)
    {
        $ord = 1;
        foreach ($values as $val) {

            if (is_bool($val)) {

                $stmt->bindValue($ord, $val, \PDO::PARAM_BOOL);

            } elseif (is_resource($val)) {

                $stmt->bindValue($ord, $val, \PDO::PARAM_LOB);

            } elseif ((string)$val === ((string)(int)$val)) {

                $stmt->bindValue($ord, $val, \PDO::PARAM_INT);

            } else {

                $stmt->bindValue($ord, $val, \PDO::PARAM_STR);
            }
            $ord++;
        }

        return $stmt->execute();
    }
108866
public function queryWithParam(string $query, array $param): PDOStatement
    {
        $statement = $this->prepare($query);

        foreach ($param as $value) {
            $this->checkValue($value);

            //reassign as reference
            //because bindParam need it as reference
            $ref = $value;
            $ref[1] = &$value[1];

            \call_user_func_array([$statement, "bindParam"], $ref);
        }

        $this->lastOperationStatus = $statement->execute();

        return $statement;
    }
365236
public function bindValues($query) {
        if (!empty($this->bind_values) && !empty($this->bind_keys)) {
            if (!$query instanceof \PDOStatement) {
                $this->setError('q', 'No valid PDO Statement provided');
            }

            for ($ii = 0; $ii < count($this->bind_values); $ii++) {
                $param = $this->get_PDO_param($this->bind_values[$ii]);
                $value = $this->bind_values[$ii];
                $key = $this->bind_keys[$ii];

                $query->bindValue($key, $value, $param);
            }
        }
    }
1247220
private function bind($stmt) {

		$meta 	= $stmt -> result_metadata();
		$double = [];
		$vars 	= [];

		if($stmt -> field_count > 0) {

			while($field = $meta -> fetch_field()) {

				$columnname  = $field -> name;
				${$columnname} = null;
				
				if(true === array_key_exists($columnname, $vars)) {
					$double[] = $columnname;
				}
				else {
					$vars[$columnname] = &${$columnname};
				}
			}
		}

		if(count($double) > 0) {
			return trigger_error(sprintf('Column %s in field list is ambiguous', implode(', ', array_unique($double))));
		}

		call_user_func_array([$stmt, 'bind_result'], $vars);

		return $vars;
	}