title: How to insert backslashes(\) to a string with special characters in it before saving to the mysql DB
body: <p>I tried to use addslashes() command in my php script. But this function is not appending backslash() before special characters in the string. </p>
  
  <p>Is there any other way to insert \ before special characters in string?</p>
  
  <p>Here is my code:</p>
  
  <pre><code> function save_params() {
   global $order_status;
  
   $args = func_get_args();
   foreach ($args as $k =&gt; $param)
    if (isset($_REQUEST[$param])) 
  $order_status[$param] = mysql_real_escape_string("$_REQUEST[$param]");
    else
     $order_status[$param] = null;
     }
  </code></pre>
  
  <p>From the code above, title is the string provided by the user. This may have special characters in it. I have provided mysql_real_escape string to escape special characters in it. Untill here it is fine. 
  But the issue is i'm using javascript tooltip to hover the title for the product. 
  Function for tooltip is provided as below:</p>
  
  <pre><code>   class="notfree{$g-&gt;id}"  
     onmouseover = "tooltip.show('{$w-&gt;title}');" 
     onmouseout="tooltip.hide();"
  </code></pre>
  
  <p>$w->title is the title we saved into the DB with special strings. Tooltip.show function is not displaying hover with the special characters in the title. so i want to add backslashes for the special characters in the "title" before entering into the Database.</p>
  
  <p>Please help me ..i'm stuck here</p>