Whenever I'm trying to insert data that has an apostrophe in it, I receive a
mysql syntax error
Example text in textarea : I'm an alien
will throw a syntax error when I try to insert in the database. I'm using real_escape_string
and still is not working.
query snippet
$text=mysqli_real_escape_string($db,stripslashes(strip_tags(trim($_POST['text']))));
markup
<textarea name='text' placeholder="Type your message here... " value=''></textarea>