Re: SqLite INSERT want not write
| From: | Stuart Dallas | Date: | Thu, 19 Apr 2012 19:43:52 +0000 |
| Subject: | Re: 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-317634@lists.php.net to get a copy of this message | ||
On 19 Apr 2012, at 20:40, siefke_listen@web.de wrote:
> 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
What does the script output? The only path through your script that doesn't display something
is if there are missing $_POST elements, and the PDO errors you've shown previously suggest
that they're all present and correct.
So if the thing is running correctly, regardless of what's going into the DB, you should be
getting some sort of output. Are you?
-Stuart
--
Stuart Dallas
3ft9 Ltd
http://3ft9.com/