Category Archives: PHP

Intermediate PHP and MySQL course

Since 1999 I’ve been teaching online for the Open University. It may not pay brilliantly, but it’s regular income and I really enjoy doing it; OU students often overcome major barriers to achieve a qualification they missed out on earlier … Continue reading

Posted in Databases, PHP, Web development | Tagged , | Leave a comment

Date handling in PHP and MySQL

It’s always a real headache manipulating dates between PHP and MySQL, because PHP’s date functions assume Unix timestamps, while MySQL has its own internal date format. They both have excellent built-in functions for handling dates, but they are fundamentally incompatible. … Continue reading

Posted in Databases, PHP, Web development | Tagged | Leave a comment

Downright Slippery Time

Want to add one (or more) days to a date in PHP? Timestamps are simply numbers of seconds, so it seems so easy and obvious to do this: $mydate = (60*60*24)+$mydate; or even just $mydate = 86400+$mydate; Don’t be tempted! … Continue reading

Posted in PHP, Web development | Leave a comment

Scriptaculous without Javascript

Scriptaculous is one of the better-known Javascript/AJAX libraries, with useful built-in objects for adding Web 2.0 functionality to your pages. I’ve tinkered with it but hadn’t found a real-life application for it until I needed to allow a client to … Continue reading

Posted in Javascript, PHP | Tagged | Leave a comment

Neat tricks with Oracle

The task: provide a neat hierarchical tree as a web interface to a project management system where any project might have a variable number of sub-projects. A tree structure in other words. So I ended up with this: ID Project … Continue reading

Posted in Databases, Javascript, PHP, Web development | Tagged , | Leave a comment

Bound to succeed

I’ve been developing websites with PHP for about 5 years now and I blush to confess that I have only just discovered I can use bind parameters with SQL, instead of painstakingly building up my SQL statements by concatenating strings, … Continue reading

Posted in Databases, PHP, Web development | Tagged | Leave a comment

Saying no to spammers

These days practically every website has a “contact us” form allowing visitors to send email to the site owner without exposing the recipient’s email address to the world. Lately I’ve been investigating ways that spammers can hijack these forms to … Continue reading

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