public function fetchRow(string $sql, array $params = [])
    {
        $stmt = $this->prepare($sql, $params);
        $result = $stmt->fetch(\PDO::FETCH_ASSOC);

        $this->ok();
        return $result;
    }
public function fetchRow(string $sql, array $params = [])
    {
        $stmt = $this->prepare($sql, $params);
        $result = $stmt->fetch(\PDO::FETCH_ASSOC);

        $this->ok();
        return $result;
    }
public function fetchRow ( string $ sql , array $ params = [ ] ) { $ stmt = $ this -> prepare ( $ sql , $ params ) ; $ result = $ stmt -> fetch ( \ PDO :: FETCH_ASSOC ) ; $ this -> ok ( ) ; return $ result ; }
Returns an array containing first row from the result set

Example of usage
<code>
$db->fetchRow("SELECT name, email FROM users WHERE id = ". $db->quote($id));
$db->fetchRow("SELECT name, email FROM users WHERE id = ?", [$id]);
$db->fetchRow("SELECT name, email FROM users WHERE id = :id", [':id'=>$id]);
</code>

@param  string $sql     SQL query with placeholders
"SELECT * FROM users WHERE name = :name AND pass = :pass"
@param  array  $params  params for query placeholders (optional)
array (':name' => 'John', ':pass' => '123456')

@return array|false     array ('name' => 'John', 'email' => 'john@smith.com')
@throws DbException
Returns an array containing first row from the result set