freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: Daniel Fazekas <fdsubs AT axelero.hu>
- To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
- Subject: Re: [freetds] PHP: Inserts with Unicode
- Date: Wed, 21 Jan 2004 20:23:26 +0100
On Jan 21, 2004, at 9:25, Marco Brinkmann wrote:
I can read and display all NTEXT and NVARCHAR-Fields from MSSQL correctly.
But if I try to write the read data into the database I get always the parse
error "Unclosed quotation mark...".
The Insert looks like...
db("INSERT INTO table (test) (N'".addslashes($read)."')");
1. It's asking for serious trouble if you really are using the keyword "table" as the name of your table. If you insist, you'll have to enclose it in square brackets:
INSERT INTO [table] (test) VALUES ('xxxx');
2. What's addslashes() supposed to do? MSSQL does not use slashes to escape quotation marks, it's the same as in Sybase, you just have to double any single quotation marks. For example: str_replace("'", "''", $str);
3. Your query seems to be missing the keyword "VALUES". It's no wonder if it doesn't work that way. :)
4. Try removing that N character. It should work both with and without it.
--
fds
-
[freetds] PHP: Inserts with Unicode,
Marco Brinkmann, 01/21/2004
- Re: [freetds] PHP: Inserts with Unicode, Daniel Fazekas, 01/21/2004
- <Possible follow-up(s)>
- RE: [freetds] PHP: Inserts with Unicode, Lowden, James K, 01/21/2004
- RE: [freetds] PHP: Inserts with Unicode, ZIGLIO, Frediano, VF-IT, 01/21/2004
Archive powered by MHonArc 2.6.24.