I have been struggling with a small problem for a while. It\'s been there for years but it\'s just been an irritating problem and not a serious one, and I have just worked a
Just use prepared statements and you wouldn't have to worry about escaping or sql injection.
$con = <"Your database connection">; $input = "What's up?"; $stmt = $con->prepare("insert into `tablename` (`field`)values(?)"); $stmt->bind_param("s",$input); $stmt->execute();