Will execute the query (if it's not executed already) and return
first row.

@param int $mode PDO fetch mode

@return mixed return result of PDO::fetch
542071
public function fetch($mode = PDO::FETCH_ASSOC)
    {
        if (!$this->stmt) {
            $this->execute();
        }

        return $this->stmt->fetch($mode);
    }
699765
public function executeRawQuery($query)
    {
        $resultSet = null;
        if($this->odbAdapter) {
            if(!empty($query)) {
                $resultSet = $this->getDbAdapter()->query($query, DbAdapter::QUERY_MODE_EXECUTE);

            }
        }


        return $resultSet;
    }
986933
public function getRow ($id)
		{
			$query = $this->database->createQuery()
				->whereEqual($this->table . '.' . $this->getPrimaryKey(), $id)
				->limit(1);

			return $this->getRows($query)->fetchRow();
		}
999074
protected function fetch($sql)
    {
        try {
            try {
                $stm = Connect::getConn()->prepare($sql);
            } catch (Exception $e) {
                static::$response["status"] = "error";
                static::$response["response"] = $e->getMessage();
                static::$response['code'] = $e->getCode();
               return static::terminate(static::$response);

            }
            try {
                $stm->execute();
            } catch (Exception $e) {
                static::$response["status"] = "error";
                static::$response["response"] = $e->getMessage();
                static::$response['code'] = $e->getCode();
               return static::terminate(static::$response);
            }
        } catch (Exception $e) {
            static::$response["status"] = "error";
            static::$response["response"] = $e->getMessage();
            static::$response['code'] = $e->getCode();
           return static::terminate(static::$response);

        }
        try {
            $data = null;
            // set the resulting array to associative
            $stm->setFetchMode(PDO::FETCH_ASSOC);
            foreach (new RecursiveArrayIterator($stm->fetchAll()) as $k => $v) {
                $data[] = $v;
            }

            if ($data == null) {
                static::$response["status"] = "success";
                static::$response["response"] = Null;
                static::$response['code'] = 300;
               return static::terminate(static::$response);
            }
            static::$response["status"] = "success";
            static::$response["response"] = $data;
            static::$response['code'] = 200;
            return static::terminate(static::$response);


        } catch (PDOException $e) {
            static::$response["status"] = "error";
            static::$response["response"] = $e->getMessage();
            static::$response["code"] = $e->getCode();
           return static::terminate(static::$response);
        }


    }
1101848
public function query($statement, $mode=null, $p1=null, $p2=null)
    {
        // TODO: use mode and parameters
        $stmt = null;
        try {
            $stmt = new Statement($this, $statement);
            $stmt->execute();
            $this->setError();
            return $stmt;
        } catch (\Exception $e) {
            throw new \PDOException($e->getMessage());
        }
        return $stmt;
    }
1286436
public function getLine($mode = self::RETURN_EVERY_LINE)
    {
        if ($this->handle) {
            $line = fgets($this->handle);
            if ($line === false) {
                $this->close();
                return null;
            }
            ++$this->lineNumber;
            if ($mode === self::SKIP_EMPTY_LINES && self::isEmpty($line)) {
                return self::getLine($mode);
            }
            return rtrim($line, "\r\n");
        }
        return null;
    }
256367
public function first(string $query, array $params = [], ...$fetchMode)
	{
		$prepared = $this->prepare($query, $params);

		$this->execute($prepared);

		if(!empty($fetchMode))
		{
			$prepared['statement']->setFetchMode(...$fetchMode);
		}

		return $prepared['statement']->fetch();
	}
410207
public function fetch($query)
    {
        $result = $this->query($query);

        return $result->fetch(\PDO::FETCH_ASSOC);
    }
1019946
public function &getOneRow($query)
    {
        $result = $this->execute($query);
        if ( $result != false ) {
            return $result->fetch(PDO::FETCH_ASSOC);
        }
        return false;
    }
54773
public function query($fetchMode = null, $bind = array())
    {
        if (!empty($bind)) {
            $this->bind($bind);
        }

        $stmt = $this->_adapter->query($this);
        if ($fetchMode == null) {
            $fetchMode = $this->_adapter->getFetchMode();
        }
        $stmt->setFetchMode($fetchMode);
        return $stmt;
    }
543938
public function setFetchmode($mode)
    {
        if (is_numeric($mode)) {
            $this->fetchMode = (int) $mode;
        } else {
            if (defined($mode)) {
                $this->fetchMode = constant($mode);
            } else {
                throw new BuildException("Invalid PDO fetch mode specified: " . $mode, $this->getLocation());
            }
        }
    }
32241
public function find($table, $fields = null, $where = null, $order = null, $limit = null, $offset = null, $array = array(), $fetchMode = \PDO::FETCH_ASSOC)
     {
         $sql = ' SELECT '.(($fields) ?? '*').' FROM '.(($table)).(($where) ? ' WHERE '.$where : ' ')
            .(($limit) ? ' LIMIT '.$limit : ' ')
            .(($offset && $limit) ? ' OFFSET '.$offset : ' ')
            .(($order) ? ' ORDER BY '.$order : ' ');

         $stmt = $this->conn->prepare($sql);

         foreach ($array as $key => $values) {
             return  $stmt->bindValue("$key", $values);
         }
         $stmt->execute();

         do {
             return $stmt->fetchAll($fetchMode);
         } while (
            $stmt->nextRowset());
         $stmt->close();
     }
545704
public function getLine($mode = self::RETURN_EVERY_LINE)
    {
        $line = parent::getLine($mode);
        if ($line === null) { return null; }
        return $this->splitLine($line);
    }
595859
public function finds($condition = NULL, $rows = 0, $start = 0, $order='', $fields = '*', $fetchMode=PDO::FETCH_ASSOC) {
		if (is_array($condition)) {
			$where = $condition[0];
			$params = $condition[1];
		} 
		else {
			$where = $condition;
			$params = null;
		}
		return $this->driver
            ->field($fields)
            ->where($where, $params)
            ->orderby($order)
            ->limit($rows, $start)
            ->fetchAll($fetchMode);
	}
262693
public function selectManager($sql, $array = array(), $fetchMode = \PDO::FETCH_ASSOC)
     {
         $stmt = $this->conn->prepare($sql);

         foreach ($array as $key => $values) {
             $stmt->bindValue("$key", $values);
         }
         $stmt->execute();

         do {
             return $stmt->fetchAll($fetchMode);
         } while (
            $stmt->nextRowset());
     }
790304
protected function fetch($limit = null, $offset = null)
    {
        if (is_int($limit)) {
            $this->statement->limit($limit, $offset);
        }

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

        if ($this->model instanceof Models) {
            $statement->setFetchMode(\PDO::FETCH_INTO, $this->model);
        } else {
            $statement->setFetchMode(\PDO::FETCH_CLASS|\PDO::FETCH_PROPS_LATE, $this->model);
        }

        return $statement;
    }
712674
public function fetch(int $fetch_style = \PDO::FETCH_ASSOC, int $cursor_orientation = null, int $cursor_offset = null)
    {
        $this->execute();
        
        return $this->stmt->fetch($fetch_style, $cursor_orientation, $cursor_offset);
    }