🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.php
Article #231804

Re: sqlite3 - php, problem ze ścieżką

#231804
From: Lemat
Date: Sun, 10 Sep 2017 21:58
39 lines
2235 bytes
W dniu 10.09.2017 o 17:38, moblaza@gmail.com pisze:
> Cześć. Mam pewien problem, kiedy w konsoli z palca odpalę skrypt:
> 
> <?php
> /**
>   * Simple example of extending the SQLite3 class and changing the __construct
>   * parameters, then using the open method to initialize the DB.
>   */
> class MyDB extends SQLite3
> {
>      function __construct()
>      {
>          $this->open(forum.db');
>      }
> }
> 
> $db = new MyDB();
> 
> $db->exec('CREATE TABLE foo (bar STRING)');
> $db->exec("INSERT INTO foo (bar) VALUES ('This is a test')");
> 
> $result = $db->query('SELECT bar FROM foo');
> var_dump($result->fetchArray());
> 
> echo 'END.';
> 
> ?>
> 
> działa on prawidłowo, jednak kiedy odpalam go w przeglądarce, wyświetlana jest pusta strona - nie odnajduje mi wskazanej bazy danych, jest ona w tym samym folderze co skrypt. Jak rozwiązać ten trywialny problem ? Dzięki.
> 

pokaż wynik funkcji:

var_dump(is_writable ( 'forum.db' ));
var_dump(is_readable ( 'forum.db' ));

-- 
Pozdrawiam
Lemat
Technical Details
Message-ID: <59b5b59d$0$5157$65785112@news.neostrada.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!news.nask.pl!news.nask.org.pl!news.unit0.net!feeder.erje.net!1.eu.feeder.erje.net!ecngs!feeder2.ecngs.de!81.171.118.62.MISMATCH!peer02.fr7!futter-mich.highwinds-media.com!news.highwinds-media.com!newsfeed.neostrada.pl!unt-exc-01.news.neostrada.pl!unt-spo-a-02.news.neostrada.pl!news.neostrada.pl.POSTED!not-for-mail
References: <5e4571d4-aa9c-4509-a18e-c0b7aa8df2e0@googlegroups.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!news.nask.pl!news.nask.org.pl!news.unit0.net!feeder.erje.net!1.eu.feeder.erje.net!ecngs!feeder2.ecngs.de!81.171.118.62.MISMATCH!peer02.fr7!futter-mich.highwinds-media.com!news.highwinds-media.com!newsfeed.neostrada.pl!unt-exc-01.news.neostrada.pl!unt-spo-a-02.news.neostrada.pl!news.neostrada.pl.POSTED!not-for-mail
Subject: Re: sqlite3 - php, problem ze ścieżką
Newsgroups: pl.comp.lang.php
References: <5e4571d4-aa9c-4509-a18e-c0b7aa8df2e0@googlegroups.com>
From: Lemat <#@lemat.priv.pl>
Date: Sun, 10 Sep 2017 23:58:53 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1
MIME-Version: 1.0
In-Reply-To: <5e4571d4-aa9c-4509-a18e-c0b7aa8df2e0@googlegroups.com>
Lines: 39
Message-ID: <59b5b59d$0$5157$65785112@news.neostrada.pl>
Organization: Telekomunikacja Polska
NNTP-Posting-Host: 159.205.35.38
X-Trace: 1505080733 unt-rea-a-01.news.neostrada.pl 5157 159.205.35.38:35546
X-Complaints-To: abuse@news.neostrada.pl
X-Received-Bytes: 1990
X-Received-Body-CRC: 940941428
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit