i have simple page which takes comment from user and add it to database. it even works good whenever there is plane comment of user. but when users comment contains symbol like ' this it shows error. plz help
code is:---
$title=$_POST['title'];
$message=$_POST['message'];
$message=htmlspecialchars($message);
mysqli_query($conn,"insert into
diary(no,datetime,title,mydiary)values(null,now(),'$title','$message')");
and error when comment contains symbol '
Error description: You have an error in your SQL syntax; check the manual
that corresponds to your MySQL server version for the right syntax to use
near 'th')' at line 1