title: How to add a single quote when I have single quote in PHP for SQL Management studio
body: <p>I am having trouble with SQL Management studio and I do not want to connect to this SQL server I want to make the data ready for my lines to be inserted in this database
  I have a text file with the lines of strings that I want to insert in sql server the line is like this:</p>
  
  <p><code>You're Doing It Wrong!!,Mike Walsh,Intermediate</code></p>
  
  <p>So it should be like this to be ready for sql server.</p>
  
  <p><code>You''re Doing It Wrong!!,Mike Walsh,Intermediate</code></p>
  
  <p>I also have this in lines:</p>
  
  <p><code>Never Have to Say "Mayday!!!" Again</code></p>
  
  <p>Is this one going to become a problem? Should I have any plan for it also?</p>
  
  <p>I tried to use addslash and then replace the slash with the a single quote by doing:</p>
  
  <pre><code>  $str=",('".addslashes ($array[0])."')";
       $str=str_replace("\\","\'",$str);
       echo $str;
  </code></pre>
  
  <p>I did the comma and parenthesis for when I have insert to query in sql server
  the result of this one will be:</p>
  
  <pre><code>    ,('You\''re Doing It Wrong!!'),
  ,('Never Have to Say \'"Mayday!!!\'" Again'),
  </code></pre>
  
  <p>What did I do wrong here?</p>