mysql_real_escape_string
mysql_real_escape_string — Escapes special characters in a string for
use in an SQL statement
This function must always (with few exceptions) be used to make data safe before sending a query to MySQL.
So you need to create a databsae connection before use of mysql_real_escape_string
$link = mysql_connect('mysql_host', 'mysql_user', 'mysql_password')
OR die(mysql_error());
echo 'What is Your Name='.mysql_real_escape_string("my name is ");
Output
What is Your Name=my name is
Updated
As per our discussion you are using mysqli so you are mixing mysql and mysqli in your code
mysqli_real_escape_string($con,("my name is 'kk/'");//pass first parameter your database connection