title: htmlspecialchars decode php mysql
body: <p>I posted some inputs with special characters.
  Here are some input example i'm trying to insert into db:</p>
  
  <pre><code>&lt;input type='text' name='address' value ='P. 34/1 Ap. 4/4 Rome, "xxx" street'&gt;
  &lt;input type='text' name='detail' value ='VAT Reg. No'&gt;
  </code></pre>
  
  <p>I inserted the inputs in db like these:</p>
  
  <pre><code>htmlspecialchars($_POST['address']);
  htmlspecialchars($_POST['detail']);
  
  $db-&gt;sql_query(
      "INSERT INTO company SET 
          option_type=1, 
          option_name='". htmlspecialchars($address)."', 
          option_value='". htmlspecialchars($detail)."'"
  ); 
  </code></pre>
  
  <p>I retrieved the records: </p>
  
  <pre><code>&lt;input type="text" value="htmlspecialchars_decode($rows['address'])"&gt; 
  &lt;input type="text" value="htmlspecialchars_decode($rows['detail'])"&gt;
  </code></pre>
  
  <p>This is ok till now, the values are correctly inserted like:</p>
  
  <p>adress: <code>P. 34/1 Ap. 4/4 Rome, quot;xxxquot; street</code></p>
  
  <p>detail: <code>VAT Reg. No</code></p>
  
  <p>But the problem is when i read them from DB, it displays nothing. I tried to  use <code>htmlspecialchars_decode</code> and <code>htmlentities()</code> but i'm not getting all characters correctly displayed.</p>
  
  <p>When i used htmlspecialchars_decode() to display the values, only the <code>detail</code> value isn't displayed at all, the address is ok.</p>
  
  <p>Please, can anybody help me?</p>