RE: [PHP] SqLite INSERT want not write
| From: | Steven Staples | Date: | Thu, 19 Apr 2012 19:50:37 +0000 |
| Subject: | RE: [PHP] SqLite INSERT want not write | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-317635@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: siefke_listen@web.de [mailto:siefke_listen@web.de]
> Sent: April 19, 2012 3:40 PM
> To: php-general@lists.php.net
> Subject: Re: [PHP] SqLite INSERT want not write
>
> Hello,
>
> On Thu, 19 Apr 2012 15:17:06 -0400
> "Steven Staples" <sstaples@mnsi.net> wrote:
>
> > Ok, so I was wrong... ;) it does happen
> >
> > Try this:
> > $sql = "INSERT INTO bloggen (date, autor, title, teaser, content)
> > VALUES ('" . date('Y-m-d H:i:s') . "', :autor,
> > :title,
> > :teaser, :content);";
>
> No errors, but no entry in the database.
>
>
> > Or
> > $sql = "INSERT INTO bloggen (date, autor, title, teaser, content)
> > VALUES (NOW(), :autor, :title, :teaser, :content);";
>
>
> PDOException: SQLSTATE[HY000]: General error: 1 no such function: NOW
>
> Now is not availible in Sqlite, can use date,
>
> Which rights must have the database?
>
> siefke@gentoo-desk db $ ls -l
> insgesamt 4
> -rw-rw-rw- 1 siefke siefke 4096 19. Apr 21:25 silviosiefke.db
>
>
> Regards
> Silvio
>
Ok, shot in the dark here.... are you closing your connection to the
sqlite db? From what I see, you're not... when I was writing an app in
Python, I remember having this issue, and because I didn't close the
connection, it didn't commit the writes to the database... just a
thought...
Steve.