sql input statement, how can i input the character " ' "(apostrophe)?
807606Jun 22 2006 — edited Jun 8 2007i know this this question had been answered, but i am having a hard time understanding it. so how can i make mysql db disregard the character ' ?
i think i need to use some escape statement or something. lets say the code is something like this:
try{
Statement stmt;
ResultSet rs;
Class.forName("com.mysql.jdbc.Driver");
String url ="jdbc:mysql://localhost:3306/test";
Connection con = DriverManager.getConnection(url, "username", "password");
stmt = con.createStatement();
stmt.executeUpdate("UPDATE smbtable SET points = '"+newgender+"' where celNum = '"+celno+"'");
con.close();
}
catch( Exception e ) {
e.printStackTrace();
}
and the variable celno has a string like this "mark's cell number"... how so i make mysql treat this as one whole string despite the ' (apostrophe) sign?