On Thu, 18 Oct 2001, Matt Klicka wrote:

> I'm trying to enter data into MySQL and can't seem to
> be able to enter the question mark and the quote
> characters. I've tried every way of quoting (and
> backslashing) I can think of to no avail. With the
> quote I get an error from MySQL saying the query was
> bad (i.e. the query ended at the quote) and with the
> question mark it gets entered as a funky block that,
> when read from mysql and printed by perl, is "NULL".
> This is probably more of a MySQL question than perl
> but I haven't been able to find anything in any of the
> MySQL documentation about it so I'm not so sure.

You need to escape the characters in question with a \

INSERT INTO names VALUES ('O\'Connor', 'question\?');

This is pretty standard with all SQL servers.  I think you can also escape
the ' with a ':

O''Connor

-- Brett
                                          http://www.chapelperilous.net/
------------------------------------------------------------------------
Like punning, programming is a play on words.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to