Re: SQLite problem INSERTing string
| From: | Stefan Reimers | Date: | Sun, 19 Sep 2004 17:58:14 +0000 |
| Subject: | Re: SQLite problem INSERTing string | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-36259@lists.php.net to get a copy of this message | ||
Hi again,
first of all thanks for quick suggestions.
After some more testing, I can get more specific:
This might be a more general problem than the "." in the error message. Even when I use $val = "hello" I get an equivalent error message
sqlite_query(): near "hello"
As said, I have done all the quoting stuff, so \' instead of ' was no solution either, until I tried double quotes instead of single ones, just as M Saleh Eg suggested. So the following statement finally works:
$query = "INSERT INTO node (uri,name) VALUES (\"$val\",\"\")";
Just for everybody else:
SQLite does not support the SET statement in INSERTs, so
INSERT INTO table SET attr=val
would not work.
Thx
Stefan