MySQL Forums
Forum List  »  General

quotes and backslashes in VARCHAR()
Posted by: dziola
Date: April 18, 2005 05:39PM

I know to solve the problem of a single quote or backslash you add another one infront of the first so MySQL understands it as a single quote or backslash. In my java program though the user enters a string into a textfield and I am not there to add the extra quote or backslash into the string when they enter the string. I could probably write a method which takes care of that for me, but there must already be a MySQL command or function that takes care of that for me that I can add into my program line. My text book briefly notes a mysql_real_escape_string() method but it does not explain it very well. If someone can help me with this that would be helpful.

Here is an example of a line of code in my program.

c.execute("INSERT INTO PROFILE set authent = 'Derek's To Do List' ");

Options: ReplyQuote


Subject
Written By
Posted
quotes and backslashes in VARCHAR()
April 18, 2005 05:39PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.