Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 96260 invoked by uid 500); 22 Oct 2001 09:12:23 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk Reply-To: tomcat-user@jakarta.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 96249 invoked from network); 22 Oct 2001 09:12:22 -0000 Message-ID: <007801c15ad9$1f258440$b8ce72c0@duddy> From: "David Treves" To: References: Subject: Re: Handling apostrophes Date: Mon, 22 Oct 2001 11:08:31 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1255" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi there, you should simply duplicate in every input string the apostrophe. Meaning that if the input string is: eee'eee after manipulating it - BEFORE inserting it to the DB it will be: eee''eee ( ' twice, NOT A double quote) in the DB it will appear as SINGLE apostrophe. That will work! :o) David. ----- Original Message ----- From: To: Sent: Monday, October 22, 2001 10:55 AM Subject: Handling apostrophes > Hi all, > > I'm developing an application which uses java servlets and JSPs and > a MySQL database running on Tomcat 4.0. > > I take user input, store it on the db, then display it again. As > soon as someone tried inputiing an apostrophe, it all fell over. It seems > that I have to encode and decode every single text field. Is this correct, > or is there a better way ? > > Thanks > > Dave > >