Re: SqLite INSERT want not write

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 19 Apr 2012, at 19:57, Steven Staples wrote:

> I think all you had to do was change this line: (line 27 in the original
> paste)
> $sql = 'INSERT INTO bloggen (date, autor, title, teaser, content)
>      VALUES ('' . date( 'Y-m-s H:i:s', time() ) . '', :autor, :title,
> :teaser, :content);';
> 
> To this:
> $sql = "INSERT INTO bloggen (date, autor, title, teaser, content)
>      VALUES ('' . date( 'Y-m-s H:i:s', time() ) . '', :autor, :title,
> :teaser, :content);";
> 
> 
> The issue was (without looking any deeper) the quotes...
> 
> Try that, and let us know.


Still wrong. It should be as follows.

$sql = "INSERT INTO bloggen (date, autor, title, teaser, content)
     VALUES ('" . date( 'Y-m-s H:i:s', time() ) . "', :autor, :title,
:teaser, :content);";

Incidentally, the time() in the date call is unnecessary since that's the default value for that parameter.

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux