Terence Eden. He has a beard and is smiling.

Terence Eden’s Blog

Theme Switcher:

Doctrine - difference between bindValue() and setParameter() on prepared statements

· 1 comment · 400 words · Viewed ~1,235 times


Doctrine project logo.

This pissed me off and I couldn't figure out what I was doing wrong. So I'm blogging about my ignorance. Imagine you're using Symfony and Doctrine to access a database. You are using prepared statements to prevent any SQL injection problems. There are two main ways of doing this - and they disagree about how positional variables should be specified. Data Retrieval And Manipulation Here's a…

Using Soundex to find Duplicate Database Entries

· 2 comments · 550 words · Viewed ~313 times


Benches on a website. One is called "Bertie" the other "Bert".

Our community website - OpenBenches - has over seventeen thousand crowd-sourced entries. The nature of user-generated content is that there are bound to be duplicates. Especially around popular walking routes. Here's how I culled around 200 duplicates using the awesome power of SOUNDEX! Soundex is a clever algorithm for reducing a string of characters into a string which roughly represents its …

HOWTO: Regenerate Gravatars in WordPress

· 300 words


The Logo for WordPress.

A troublesome plugin recently corrupted some of the avatars on my blog's comments. This is a quick HOWTO for regenerating them. Gravatars are based on the MD5 hash of a user's email. For some reason, the plugin had overwritten the avatar field with the text http://identicon This MySQL query finds all the comment IDs which have that dodgy text: SELECT comment_id FROM `wp_commentmeta` …

Open Source Shakespeare (in MySQL)

· 11 comments · 500 words · Viewed ~1,788 times


My good friend Richard Brent has often complained that my blog has very little Shakespeare content. Despite the domain name, I don't think I've ever blogged about The Big S. For shame! Fear not, my Brentish-Boy, this post is all about Shakespeare. And MySQL.... Ahem... When I first started shkspr.mobi it was intended to be an easy way to get Shakespeare on your phone. At that time, there…