Re: excec / query on Sqlite3

Matijn Woudt <[email protected]>
Newsgroups gmane.comp.php.database
Message-ID <CAC_gtuNzm2B9es+LuzbvymKgTF=7R4PnPQpSkh0=tL3iTxeQUA@mail.gmail.com>
On Mon, May 20, 2013 at 2:35 PM, Gilles <[email protected]> wrote:

> Hello,
>
> I'm not sure if it's a bug :
>
> $o_sqlite3=new SQLite3('test.sqlite');
>
> $r=$o_sqlite3->exec('');
> echo'<pre>';var_dump($r);echo'**</pre>'; // bool(true)
>
> $r=$o_sqlite3->query('');
> echo'<pre>';var_dump($r);echo'**</pre>';  // bool(false)
>
> $r=$o_sqlite3->exec(false);
> echo'<pre>';var_dump($r);echo'**</pre>';  // bool(true)
>
> $r=$o_sqlite3->query(false);
> echo'<pre>';var_dump($r);echo'**</pre>';  // bool(false)
>


It makes sense in some way, query fails because the query didn't return any
result, exec succeeds because it does not require a result. The query
itself is valid.

- Matijn
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.