Note that there are some explanatory texts on larger screens.

plurals
  1. PONeutralizing "&" in Excel file
    primarykey
    data
    text
    <p>The question name is probably a bit confusing, so I'll try to clear it up. I have a database with some products, and a system of generating Excel xml files, to export these products and their prices. The problem is, when there is the "&amp;" character in a database field (usually it's the product name), the excel file that is generated is "not well formed". The other thing is, that the database is pretty large, and some product names may contain "neutralized" &amp; characters (for example <code>&amp;amp</code>, or <code>&amp;quot;</code>), but some don't, so I would have to do something like unescape and then escape to get what I need. I have already tried with</p> <pre><code>mysql_real_escape_string(htmlspecialchars($name)); </code></pre> <p>but that doesn't seem to do anything. Any help would be appreciated.</p> <p>EDIT: Maybe this will help a bit more - I have a custom made "system" of exporting products to xls files. They look something like this:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40"&gt; &lt;Worksheet ss:Name="Table1"&gt; &lt;Table&gt; &lt;Column ss:Index="1" ss:AutoFitWidth="0" ss:Width="110"/&gt; &lt;Row&gt; &lt;Cell&gt;&lt;Data ss:Type="String"&gt;Interna sifra&lt;/Data&gt;&lt;/Cell&gt; &lt;Cell&gt;&lt;Data ss:Type="String"&gt;Sifra&lt;/Data&gt;&lt;/Cell&gt; &lt;Cell&gt;&lt;Data ss:Type="String"&gt; Naziv&lt;/Data&gt;&lt;/Cell&gt; &lt;Cell&gt;&lt;Data ss:Type="String"&gt;MP cena&lt;/Data&gt;&lt;/Cell&gt; &lt;Cell&gt;&lt;Data ss:Type="String"&gt;VP cena&lt;/Data&gt;&lt;/Cell&gt; &lt;/Row&gt; &lt;Row&gt; &lt;Cell&gt;&lt;Data ss:Type="String"&gt;5263&lt;/Data&gt;&lt;/Cell&gt; &lt;Cell&gt;&lt;Data ss:Type="String"&gt;03SL8733&lt;/Data&gt;&lt;/Cell&gt; &lt;Cell&gt;&lt;Data ss:Type="String"&gt;Speed Link slušalice sa mikrofonom IUNO Mono&lt;/Data&gt;&lt;/Cell&gt; &lt;Cell&gt;&lt;Data ss:Type="String"&gt;0.00&lt;/Data&gt;&lt;/Cell&gt; &lt;Cell&gt;&lt;Data ss:Type="String"&gt;733.04&lt;/Data&gt;&lt;/Cell&gt; &lt;/Row&gt; &lt;/Table&gt; &lt;/Worksheet&gt; &lt;/Workbook&gt; </code></pre> <p>except with a lot more rows. They are generated with php, by going through the database records, and echo-ing all the lines into an ExcelXML file. I hope this makes more sense now.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload