I have a for loop that runs through a set of questions with a text area next to each question. But if the question or answer has an apostrophe in it (as if someone asked "Don't" or "Can't" in the question), it doesn't get inserted into the database. I've tried strip slashes and add slashes to get rid of the problem to no avail.
This is what I've got so far.
The for loop to display to the user the question without slashes.
for($i = 0; $i< sizeof($answered); $i++)
{
echo "<h3><center>" . stripslashes($question[$i]) . "</center></h3>";
show_form($question[$i]);
}
and the POST setup:
if ( !empty($_POST['answer']) )
{
$quest = mysqli_real_escape_string ($dbc, $_POST['question']);
$answer = mysqli_real_escape_string ($dbc, $_POST['answer']);
}