I have come to a weird problem. I have a text column in my table. I am inserting text taken from a textarea of html form into mysql database.
$sql="INSERT INTO mytable ( `username`, `firstname`, `lastname`,`about`,`email`) VALUES ('$username', '$fname', '$lname','$about','$email');";
about here is TEXT type column
And this is my textarea
<textarea id="oabout" name="about" rows="10" placeholder="Aboutyourself"></textarea>
If i insert the following text then the insertion works fine
I am a student
But if i try to insert the following text i am getting error
I'm a student
The error is shown as
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 'm a student','[email protected]')' at line 1
How can i make the change so that the second text is also inserted into the database?