Excecute select directly by PDO.

@param string $select
@param array  $param

@return \Dal\Db\ResultSet\ResultSet
771441
public function selectBridge(Select $select)
    {
        if ($this->usePaginator === true) {
            return $this->initPaginator($select);
        }

        $this->result = $this->tableGateway->selectBridge($select);

        return $this->result;
    }
302209
public function select($select = '*')
    {
        //if select is an array
        if (is_array($select)) {
            //transform into a string
            $select = implode(', ', $select);
        }
        
        $this->select = $select;
        
        return $this;
    }
1171730
public function run($sql, array $params = array())
    {
        $sth = $this->pdo->prepare($sql);

        foreach ($params as $key => $value) {
            $key = is_numeric($key) ? $key + 1 : ":$key";
            $sth->bindValue($key, $value);
        }

        $sth->execute($params);
        $this->executed[] = $sql;
        return $sth;
    }
390586
protected function executeSelect(Select $select)
    {
        $selectState = $select->getRawState();
        if ($selectState['table'] != $this->table) {
            throw new \RuntimeException('The table name of the provided select object must match that of the table');
        }

        // We don't want use default table columns as default select columns state
        /*if ($selectState['columns'] == array(Select::SQL_STAR)
            && $this->columns !== array()) {
            $select->columns($this->columns);
        }*/

        // apply preSelect features
        $this->featureSet->apply('preSelect', array($select));

        // prepare and execute
        /** @var \Zend\Db\Adapter\Driver\Pdo\Statement $statement */
        $statement = $this->sql->prepareStatementForSqlObject($select);
        $result = $statement->execute();

        // build result set
        $resultSet = clone $this->resultSetPrototype;
        $resultSet->initialize($result);

        // apply postSelect features
        $this->featureSet->apply('postSelect', array($statement, $result, $resultSet));

        return $resultSet;
    }
587242
protected function createSubQueryBuilder($select = null)
    {
        if (!$select) {
            $select = $this->getSelectAs($this->idField);
        }

        // get all filter-fields
        $filterFields = $this->getAllFields(true);

        // get entity names
        $entityNames = $this->getEntityNamesOfFieldDescriptors($filterFields);

        // get necessary joins to achieve filtering
        $addJoins = $this->getNecessaryJoins($entityNames);

        // create querybuilder and add select
        $queryBuilder = $this->createQueryBuilder($addJoins)->select($select);

        if ($this->user && $this->permission && array_key_exists($this->permission, $this->permissions)) {
            $this->addAccessControl(
                $queryBuilder,
                $this->user,
                $this->permissions[$this->permission],
                $this->securedEntityName,
                $this->encodeAlias($this->securedEntityName)
            );
        }

        return $queryBuilder;
    }
1192471
public function select($select = '*')
    {
        //Argument 1 must be a string or array
        Argument::i()->test(1, 'string', 'array');
        
        //if select is an array
        if (is_array($select)) {
            //transform into a string
            $select = implode(', ', $select);
        }
        
        $this->select = $select;
        
        return $this;
    }
1219488
private function prepareSelect(array $select)
    {
        if ($select['sql'] instanceof SelectQuery) {
            $columnsCount = count($this->columns);

            $selectColumnsCount = count($select['sql']->getColumns());

            if ($selectColumnsCount and $selectColumnsCount !== $columnsCount) {
                throw new SqlException('INSERT select columns count does not match.'
                                        . ' Expected ' . $columnsCount . ', got ' . $selectColumnsCount);
            }
            [$sql, $params] = $select['sql']->toSql();

            $select['sql'] = $sql;

            $select['params'] = $params;
        }

        return $select;
    }
380950
public static function exec($sql, $params = [])
    {
        BLLog::log('[SQL] ' . $sql);
        BLLog::log('[Params] ' . var_export($params, true));
        $stmt = self::getHandle()->prepare($sql);
        $stmt->execute($params);
        return $stmt;
    }
1302369
public function fetchAssoc(Select $select, AdapterInterface $specialAdapter = null)
    {
        $this->_logger->debug(sprintf('Executing query: %s', $select->assemble()));

        $result = ! is_null($specialAdapter) ? $specialAdapter->fetchAssoc($select) :
            $this->getDefaultConnection()->fetchAssoc($select);

        $this->_logger->debug(sprintf('Query result: %s', trim(print_r($result, true))));

        return $result;
    }
532831
public function select($sql, $parameters = array()) {
        DB::addQueryLog($sql, $parameters);
        return $this->getArray($sql, $parameters);
    }
613341
public function callProcedure($procedureName = '', $bindParams = [], $isSelect = true)
    {
        $this->bindParams = $bindParams;
        $this->currentQueryIsMaster = true;
        $stmt = $this->prepare("exec {$procedureName}", $this->wlink);
        $this->execute($stmt);
        if ($isSelect) {
            return $stmt->fetchAll(\PDO::FETCH_ASSOC);
        } else {
            return $stmt->rowCount();
        }
    }
420754
public function sqlFetch(string $sql, array $params = []): ?array
    {
        return $this->prepare($sql, $params)->fetch(\PDO::FETCH_ASSOC);
    }
513496
public function exec($sql, array $params=null, array $driverOptions=null) {
		$retval = null;
		$this->sth = null;
		if(!is_null($params)) {
			$retval = $this->run_query($sql, $params, $driverOptions);
		}
		else {
			$retval = $this->dbh->exec($sql);
		}
		
		return($retval);
	}
534479
public function execute($params = null) {
		if ($params === null) {
			$params = [];
		}

		try {
			$this->stmt->execute($params);

			return new QueryResult($this->stmt, $this->pdo);
		} catch (PDOException $e) {
			throw $this->exAdapter->adapt($e, $this->stmt, $params);
		}
	}
864328
protected function fetchResult(Select $select, AbstractResultSet $resultSet = null)
    {
        $resultSet = $resultSet ?: $this->getResultSet();
        $resultSet->buffer();

        if ($this->usePaginator()) {
            $this->setUsePaginator(false);
            $resultSet = $this->paginate($select, $resultSet);
        } else {
            $statement = $this->getSql()->prepareStatementForSqlObject($select);
            $result = $statement->execute();
            $resultSet->initialize($result);
        }

        return $resultSet;
    }
440165
public function selectMany(Select $select, ResultSet\ResultSetInterface $resultSet = null)
    {
        if ($this->usePaginator) {
            $this->usePaginator = false;
            $rows = $this->initPaginator($select, $resultSet);
        } else {
            $result = $this->select($select, $resultSet);
            $rows = array();
            foreach ($result as $row) {
                $rows[] = $row;
            }
        }
        return $rows;
    }
835395
public function selectRaw(string $sql, string ...$params)
    {
        $this->addSelect($sql, $params);

        return $this;
    }