SQLite problem INSERTing string

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

 



Hello,

I am currently experiencing a problem with an INSERT statement in SQLite.

First of all an excerpt from the code:

$val = "127.0.0.1";
$query = "INSERT INTO node (uri,name) VALUES (".$val.",'bla')";

$db_name = "mysqlite";

if($db_hdl = sqlite_open($db_name)){
	
	$db_result = sqlite_query($db_hdl,$query);
		
}

I get the error message:

Warning: sqlite_query(): near ".": syntax error in C:\Programme\xampp\htdocs\dipl\testclient\sqlite_test.php on line 10

I tried addslashes (which I know I shouldn't), sqlite_escape_string, any variant of quotes etc, I asked google and the searched the news groups but with no relevant result, except the insight, that others experience the same so long unsolved problem or use a syntax in their tutorials that does not work with my code...

As you an see from the error message, I use Windows, Apache, PHP4 with SQLite in a 2.8.14 version.

If anyone has a clue, please contact me or just answer.
Thanks in advance
Stefan

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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux