Author Archives: Veronica Yuill

Overriding PHP.INI

It’s a while since I’ve needed to override the php.ini file on a per-site basis, and I hadn’t realised that since PHP 5.3, the process has changed slightly. Now, if you want a local ini file to be read, you … Continue reading

Posted in PHP, Web development | Leave a comment

MySQL: updating one table from another

I always find this a bit awkward, especially if there isn’t a straightforward (i.e. primary key) way of matching records across tables. I find the INNER JOIN syntax easier here — I always do a SELECT using the join criteria … Continue reading

Posted in Databases | Leave a comment

Timing it right

Apparently Americans have trouble with times expressed in 24-hour format and keep turning up at the wrong time as a result. Here’s yet another remedy for ludicrously over-complicated solutions to a simple date/time problem: $time = date(“g:i A”, strtotime(“17:30:00″)); That … Continue reading

Posted in PHP | Leave a comment

Cherry pickin’

Oops. Made a change in the wrong branch of my git repository. Of course I knew there had to be an easy way of merging that one commit into the right branch, and there is. How to do it in … Continue reading

Posted in Web development | Tagged | Leave a comment

Things I didn’t know about MySQL #1: GREATEST

Somehow I have used SQL for nearly 30 years without knowing about the GREATEST function. It’s only when you need to do something that looks impossible that you delve into the online manual and find gems like this. In this … Continue reading

Posted in Databases | Leave a comment

User-serviceable parts inside

Apple seem to have developed a reputation for hardware that can’t be upgraded by the user, either because it’s physically impossible, it voids the warranty, or both. However I can report success with my aged white MacBook. This isn’t a … Continue reading

Posted in Hardware, Mac | Leave a comment

I love you PHP: more date goodness

Want to display a date in a language other than English, without switching your whole installation to some other language? It’s so easy … setlocale(LC_TIME, “fr_FR”); $datefacture = strftime(“%e %B %Y”); echo $datefacture;

Posted in PHP | Tagged , | Leave a comment

PHP date calculations: last day of the month

PHP’s date() function must be my favourite PHP function. You need never struggle with manipulating dates in PHP — if you need to use more than one line of code for working out a date, you probably just haven’t looked … Continue reading

Posted in PHP | Tagged | Leave a comment

jQuery validation plugin: required select elements

I’m just posting this as a reminder to myself, but it may help others! I found that when I added class=”required” to a select element in a form, it wasn’t actually treated as required by jQuery. After some fiddling about, … Continue reading

Posted in Javascript | Tagged , | Leave a comment

Automatically updating a WordPress blogroll

Years ago, I signed up to a social bookmarking system called Spurl. I’m really not interested in social bookmarking, but it had a handy feature: by inserting a bit of Javascript in a web page, you could pull all or … Continue reading

Posted in Blogging, PHP, Web development, Wordpress | Tagged , , | Leave a comment