How To Prevent \ Showing Up Next To Quotation Marks? [duplicate]

70
October 18, 2021, at 11:20 PM
This question already has answers here:
Do I need to escape my variables if I use MySQLi prepared statements? (2 answers)
Clarity on PHP Prepared Statement Escaping (3 answers)
Should we HTML-encode special characters before storing them in the database? (6 answers)
Closed 23 hours ago.

My script has it so a user will enter in text, it will go into a MariaDB database and then come back out in the screen to simplify it. However, when a user enters ' or " it will go to the database as \' or \". I assume this is to prevent a MySQL injection attack but is there any way to prevent it from coming back on the screen escaped? My simplified code is

//$con is the connection
<?php
$msg = htmlentities(mysqli_real_escape_string($con, $_POST['message']));
$insert = $con->prepare("INSERT INTO `db` (message) values(?)");
$insert->bind_param("s", $message);
$insert->execute();

and then it will print it out on the screen from reading the database normally, nothing weird or unexpected.

READ ALSO
RFID 8500 TC52 Connection Failed RFID Batch mode in Progress

RFID 8500 TC52 Connection Failed RFID Batch mode in Progress

when i pass data from activity1 to activity2 the data will pass after connect with sdk to zebra 8500 (TC52) getting error with device high beep sound in zebra device

40
NodeJs Lan application on RPi to google cloud platform to custom domain

NodeJs Lan application on RPi to google cloud platform to custom domain

I have been able to set up my virtual machine on google cloud platform and am able to SSH into my RPi successfully using this tutorial:

27
MySQL: How to copy column of same table to another column with unix time convert

MySQL: How to copy column of same table to another column with unix time convert

I got my solution on SO on how to copy data from a column to another column but I need to convert the "from column" unix to the datetime columnColumnA is of type int and ColumnB is of type TIMESTAMP:

76
Multidimensional array replace with close range Javascript

Multidimensional array replace with close range Javascript

Let's say we have a List of ranges expressed in arrays with two elements [from, to]

40