RE: [PHP] SqLite INSERT want not write

From: Date: Thu, 19 Apr 2012 18:57:04 +0000
Subject: RE: [PHP] SqLite INSERT want not write
References: 1 2 3 4 5  Groups: php.general 
Request: Send a blank email to php-general+get-317626@lists.php.net to get a copy of this message
> -----Original Message----- > From: Silvio Siefke [mailto:siefke_listen@web.de] > Sent: April 19, 2012 2:53 PM > To: php-general@lists.php.net > Subject: Re: [PHP] SqLite INSERT want not write > > Hello, > > On Thu, 19 Apr 2012 13:21:46 -0500 > tamouse mailing lists <tamouse.lists@gmail.com> wrote: > > > Maybe this will make the syntax errors stand out more: > > > > http://dl.dropbox.com/u/571329/Screenshots/Picture%209.png > > > ok i have change it to the function date, but now i has the error > message: > > PDOException: SQLSTATE[HY000]: General error: 1 SQL logic error or missing > database > > The database is present, and the tables too. > > gentoo-desk db # ls > silviosiefke.db > gentoo-desk db # pwd > /var/www/silviosiefke_de/inc/db > > gentoo-desk ~ # php -l test.php > No syntax errors detected in test.php > > The script now -> http://nopaste.info/63fe0a9148.html > > Regards > Silvio 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. Steve

« previous php.general (#317626) next »