5 messages in com.mysql.lists.win32Re: escaping a semicolon
FromSent OnAttachments
Dexter17 Mar 2000 08:28 
Michael Ellis17 Mar 2000 09:46 
Steve Ruby17 Mar 2000 09:55 
Michael Ellis17 Mar 2000 10:09 
sin...@mysql.com18 Mar 2000 05:34 
Subject:Re: escaping a semicolon
From:Steve Ruby (ste@seawingsub.com)
Date:03/17/2000 09:55:20 AM
List:com.mysql.lists.win32

What version of the server are you using and what client is it you are inserting from? Have you tried a similar query directly from the mysql.exe client app?

I tested and have no problems directly inserting simi-colons in strings like

insert into test values ('this is a test;');

takes it and displays it like it should on 3.22.29 NT 3.23.8a Linux

Michael Ellis wrote:

Hi, Does anyone know how to escape a semicolon in a string. I'm trying to store tcl scripts in a mySQL table with insert statements that look like:

insert scripts (name,script) values ('myscript','$tclscript')

in this example, $tclscript resolves to the text of the script being stored

Escaping single-quotes and backslashes in $tclscript is straightforward, but if $tclscript contains a semicolon, I get a MySQL syntax error. I've tried escaping semicolons with backslashes and double-quotes, but still get the syntax error for every combination i've tried so far.

Thanks in advance, Mike

------------------------------------------------------------ Michael F. Ellis, P.E. Principal Frogwing Associates Software and Electronics Consultants 5 Fairland Street Lexington MA 02421 Voice 781 861 1413 Fax 781 863 2481 mel@frogwing.com

------------------------------------------------------------

To unsubscribe, send a message to the address shown in the List-Unsubscribe header of this message. If you cannot see it, e-mail win3@lists.mysql.com instead.