Re: [sqlite] Statement failing

2011-10-09 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 09/10/11 11:24, Tim Streater wrote: > But closer investigation of the SQLite3 interface does not reveal an > equivalent to the FetchAll method available under PDO. Note that SQLite itself (the C library) doesn't have it either. You call prepare

Re: [sqlite] Statement failing

2011-10-09 Thread Tim Streater
On 09 Oct 2011 at 17:00, Simon Slavin wrote: > On 9 Oct 2011, at 4:52pm, Tim Streater wrote: > >> At present, I'm using PDO and setting it to throw exceptions. So I have a >> try/catch around all my $dbh->query and in there, log what happened and >> where, report to the

Re: [sqlite] Statement failing

2011-10-09 Thread Simon Slavin
On 9 Oct 2011, at 4:52pm, Tim Streater wrote: > At present, I'm using PDO and setting it to throw exceptions. So I have a > try/catch around all my $dbh->query and in there, log what happened and > where, report to the user and then give up. I haven't looked closely at the > SQLite3 interface

Re: [sqlite] Statement failing

2011-10-09 Thread Tim Streater
On 09 Oct 2011 at 02:02, Simon Slavin wrote: > On 9 Oct 2011, at 1:39am, Tim Streater wrote: > >> On 08 Oct 2011 at 23:32, Simon Slavin wrote: >> >>> I'm not clear whether you're using the PDO or the sqlite3 extension to PHP. >> >> By the way, is one

Re: [sqlite] Statement failing

2011-10-09 Thread Stephan Beal
On Sun, Oct 9, 2011 at 3:02 AM, Simon Slavin wrote: > That is a great question, and I'd love to see answers from PHP programmers. > Personally, i prefer PDO. i like it's simplified model (unification of query and result set) and find it easy to work with. i like it so much

Re: [sqlite] Statement failing

2011-10-08 Thread Simon Slavin
On 9 Oct 2011, at 1:39am, Tim Streater wrote: > On 08 Oct 2011 at 23:32, Simon Slavin wrote: > >> I'm not clear whether you're using the PDO or the sqlite3 extension to PHP. > > By the way, is one to be preferred over the other? That is a great question, and I'd love

Re: [sqlite] Statement failing

2011-10-08 Thread Tim Streater
On 08 Oct 2011 at 23:32, Simon Slavin wrote: > On 8 Oct 2011, at 10:37pm, Tim Streater wrote: > >> I have this string: >> >> attach database ':memory:' as mem; create table mem.messages ( absid >> integer, ..., replyto text ); >> >> (where the ellipsis represents a

Re: [sqlite] Statement failing

2011-10-08 Thread Tim Streater
On 08 Oct 2011 at 23:32, Simon Slavin wrote: > On 8 Oct 2011, at 10:37pm, Tim Streater wrote: > >> I have this string: >> >> attach database ':memory:' as mem; create table mem.messages ( absid >> integer, ..., replyto text ); >> >> (where the ellipsis represents a

Re: [sqlite] Statement failing

2011-10-08 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 08/10/11 15:32, Simon Slavin wrote: > And second, the documentation says that both functions execute only one > statement. My guess is that they ignore everything after the ';' used > as a statement separator. Just to be clear it won't be that

Re: [sqlite] Statement failing

2011-10-08 Thread Simon Slavin
On 8 Oct 2011, at 10:37pm, Tim Streater wrote: > I have this string: > > attach database ':memory:' as mem; create table mem.messages ( absid > integer, ..., replyto text ); > > (where the ellipsis represents a number of other column declarations). In > PHP, I do this: > > $dbh->query

Re: [sqlite] Statement failing

2011-10-08 Thread Stephan Beal
On Sat, Oct 8, 2011 at 11:37 PM, Tim Streater wrote: > If I take the string above and split it into two calls to $dbh->query - one > to attach the memory database, the second to create the mem.messages table, > then everything works as expected. Is there something I'm

[sqlite] Statement failing

2011-10-08 Thread Tim Streater
I have this string: attach database ':memory:' as mem; create table mem.messages ( absid integer, ..., replyto text ); (where the ellipsis represents a number of other column declarations). In PHP, I do this: $dbh->query ($str); where $str contains the string from above. It completes