In my site I have a textarea whose text is inserted into a field in my database. I would like to be able to enter quotation marks and quotes without the insertion operation in the database fail. Is it possible? How can I do?
I have this code.
HTML
<div class="field">
<label class="etichetta">Descrizione</label>
<br>
<textarea name="descrizione" rows="10" cols="40" maxlength="650"></textarea>
</div>
PHP
.
.
$descrizione = $_POST['descrizione'];
$query = "INSERT INTO couponFuturi (coupon, descrizione, immagine, alt, prezzoOriginale, prezzoScontato, scadenza, sezione)
VALUES ('$coupon', '$descrizione', '$imgUrl', '$imgAlt', '$prezzoOriginale', '$prezzoScontato', '$scadenza', '$sezione')";
$result = mysqli_query($db, $query);
The insertion operation returns a syntax error caused by the presence of quotes and double quotes.