$MyStringName = mysqli_real_escape_string($dblink, $MyStringName); //Note $dblink is the database link from mysqli_connect()