In my project I am using some text box to take some input from user. But when a user insert some special characters like (',",;) it occur a error.I want to insert data in database whatever user want to insert. All special character allow. I don't understand how to solve this problem.
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'b'),'',UPPER('a,c'),'',UPPER('b's'),'','1',0)' at line 1
my html code(quesadd.php)
<tr>
<td><label>QUESTION</label></td>
<td><input class="form-control" name="txtquestionname"></td>
<td></td>
</tr>
<tr>
<td><label>ANSWER</label></td>
<td><input class="form-control" name="txtanswername"></td>
<td></td>
</tr>
my insert query code(quesadddb.php)
$quesname = $_POST['txtquestionname'];
$ansname = $_POST['txtanswername'];
$s="INSERT INTO questioninfo (questionname, answername) VALUES (UPPER('$quesname'),UPPER('$ansname'))";
mysqli_query($conn,$s) or die(mysqli_error($conn));
Data send from quesadd.php to quesadddb.php by post method from form.