� can usually be found at work at 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 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: http://support.microsoft.com/kb/323626.
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?
P.S. it’s either that or the � key is broken on my keyboard. What would � know?