How to save and display quotes?

Hello. I am writing a website with data entry into mysql database via html form using php.
There was a problem with saving and then displaying strings containing quotes (‘ and “).
Strings are not saved to the database, when escaping quotes (using the addslashes() function) they are saved, but not displayed.
Here is the code for the input field of the initial page:

echo '< input type="text" size="20" name="tender1" value="" />';

Code field code after editing:

echo '< input type="text" size="20" name="tender1" value="'.$_REQUEST['tender1'].'" />';

Codes for saving to the database (adding and changing):

mysql_query('INSERT INTO tenders (`tender1`) VALUES ("'.$_REQUEST['tender1'].'")');  
mysql_query('UPDATE `tenders` SET `tender1`="'.$_REQUEST['tender1'].'"');

Database output code:

$mysql_array_tenders = mysql_fetch_array(mysql_query('SELECT * FROM `tenders`),0); 
echo '< input type="text" size="20" name="tender1" value="'.$mysql_array_tenders['tender1'].'" />';

Tell me how to change the code so that when saving and outputting strings containing quotes (‘ and “) there would be no problems.

Answer 1

Process incoming data with mysql_real_escape_string

mysql_query('INSERT INTO tenders (`tender1`) VALUES ("'.mysql_real_escape_string($_REQUEST['tender1']).'")');