� can usually be found at work on my PC cursing Microsoft. 90% of the time Internet Explorer is the guilty party — but today � was provided with some variation on the theme: � got to curse Microsoft Excel instead. In the end, I guess this is one of the aspects of coding that I enjoy most: the challenge of solving a problem.

� am working on some PHP scripts to read data from a MySQL database and download it in CSV format. The first script worked with no problem, so � was utterly perplexed when after some minor changes to the original script to read data from another table, � started generating error messages when opened by Excel.

Being a tenacious chap, � spent about an hour or two trying to get the code to run.

Then � looked it up on Google.

At this point � would like to explain why I didn’t do this in the first place: you can’t “copy and paste” from a Microsoft error dialogue. No really. And � can never remember the text in the error correctly long enough to type it into Google.

Here is the problem as stated by Micro(if-we-post-an-article-detailing-the-problem-why-should-we-fix-it)soft themselves: https://answers.microsoft.com/en-us/msoffice/forum/all/sylk-error-when-opening-csv-files-in-excel/3764f46e-52de-49f2-a77a-21ab9cf84f75.

So a quick rename of the first thing � was echoing into the CSV file, namely: “ID” for well, the ID of the record (but which we all know is really Klingon for: “this will bork your CSV download because it starts with an uppercase ‘I’”). Oh: and don’t use uppercase ‘D’ either. Who names a column something like “ID” anyway?

�diots.

P.S. it’s either that or the � key is broken on my keyboard. What would � know?


References:

  1. SYLK error When Opening CSV Files in Excel. (2023). Available at: https://answers.microsoft.com/en-us/msoffice/forum/all/sylk-error-when-opening-csv-files-in-excel/3764f46e-52de-49f2-a77a-21ab9cf84f75 (Accessed: 29 March 2023).
  2. Symbolic Link (SYLK). (2021, October 27). In Wikipedia. https://en.wikipedia.org/wiki/Symbolic_Link_(SYLK)

By foxbeefly

PHP / MySQL Developer. HTML, CSS and some JavaScript.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from stylus

Subscribe now to keep reading and get access to the full archive.

Continue reading