Cows Can Kill

Include, include. My kingdom for an include

Posted in Work :: Comments (2)
20 April 2006 by Neil B

It's been a while since I've had a work-related rant, so here's one to help bolster the stats. We recently got a copy of a PHP website which needed to be re-developed. The website is, as with most sites these days, database driven. Although I use the word database loosely, since they use MySQL as opposed to a decent RDBMS like PostgreSQL. However, flame-wars aside, this web site was using MySQL as their database of choice.

As with all databases (even the toy ones like Mysql ;) a login is required. To do a successful login you need to know the server on which the database lives, the user which can access the database and the password for that user. Now, since this information is the same for every page in the site which requires access to the database it makes sense to have this defined in a single place in the code, then all other pages to use this definition. This also has the added advantage that if the server, username or password ever change (and yes kids, passwords should be changed frequently) then only 1 file needs to be updated.

That would be the sensible way of doing it. But did they do this? Did they buggery. At the top of every PHP file they have the server, username and password coded. Every single document. That's 63 fricking pages that need changed every time the password changes. 63 files need updating when copying files from a test environment to a live environment. 63 bloody files!! Have I made my point yet? This is one of the most fundamental things when using databases in any application. It really rather irks me.

However, on a plus note, I got my first payslip in over a year today. Not that I get paid for another week and a bit, but a payslip is good. Contracting has its advantages, but there's a lot to be said for a regular income. Means I can buy beer regularly for a start... mmmm ... beer

Sorius legius

Posted in Bike :: Comments (2)
19 April 2006 by Neil B

I have a sore leg. Yes, I can feel your sympathy from here. And it's not from cycling into work which I did a couple of days ago for the first time this year. Notice how I made that seamless link? I should be a DJ.

Anyhow, it was Monday. Monday was a public holiday. The buses were running to a funny schedule, and not the funny schedule they currently run to, but a different, funnier schedule. It was also a reasonably nice morning. Now work has moved since the last time I blogged (Admittedly the tectonic plates could have moved a few miles since my last entry but it's been a busy time) and now instead of being in Bearsden (North of Glasgow) we're slap bang in the City Centre, a mere stones throw from two previous places of employment.

Now, where was I .... oh yes. So I took the bike into work, but it was hardly worth the effort. It is now a whopping 2.8 miles from my front door to the works horror-movie-esque underground garage (more on this another day). 2.8 miles? How am I ever going to hit the 1000 mile mark by the end of the year? *cough* On the plus side, it took a mere 12 mins or so, even in the traffic, which is a damn site faster than getting the bus in and walking along.

The plan was to take the bike in tomorrow too. However, that depends on two things. The weather and the leg. I know, it's like a cliffhanger. More excitement in one of these posts than the whole 1st series of Lost. Be sure to tune in next time for another exciting ... er .. you get the idea.