Author Archives: Veronica Yuill

Book review: PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide, 4th Edition by Larry Ullman

I bought PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (4th Edition) to use as a set book for an online intermediate PHP class that I teach. I previously used Web Database Applications with PHP & MySQL by … Continue reading

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

Accessing virtual hosts across a LAN

Like many web developers, I have a local Apache/MySQL/PHP setup for developing sites. To ensure maximum compatibility with live servers, I set up a virtual host for each site. That way I know all paths will work. For example, on … Continue reading

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

More nifty SQL: insert if not exists

Quite often you want to insert a record into a table, but only if it doesn’t already exist. OK, you could first do a SELECT query to check for existence, and then do the insert, but it’s clumsy and raises … Continue reading

Posted in Databases | Tagged , | Leave a comment

ADODB database abstraction library for PHP

I’ve been using this library for years to make my database interface code database-independent, but I am still discovering new useful functions. Case in point: today I was using the handy rs2csv function, which outputs a recordset to a CSV … Continue reading

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

Preventing hotlinking of images

Using an .htaccess file to prevent people stealing bandwidth by linking directly to your images from another website is a popular and well-known technique. I needed to do this, but decided to take it a step further with a little … Continue reading

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

Who knew Javascript could be fun?

It gave me migraines till I discovered jQuery. Now I can validate a form with some simple CSS and a couple of lines of jQuery code. And today I had a rather odd requirement to toggle the colour of cells … Continue reading

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

PHP: is it a leap year?

I’ve written about date manipulation in PHP before. There are some truly horrible hacks out there. Today I needed to detect whether a given year was a leap year, in order to write future-proof code for a calendar. PHP has … Continue reading

Posted in PHP | Leave a comment

Amarok and network shares on the eee PC

The eee now spends most of its time being used as a convenient way to play music through the stereo. This means it needs to mount the shared directory on the server downstairs that contains all the music. This caused … Continue reading

Posted in Linux | Tagged , , | Leave a comment

SQL query to find duplicate rows

This is one of those things I can never remember how to do when I need to do it. I don’t know why, it’s really quite simple: SELECT emailaddress, firstname, lastname, COUNT(emailaddress) FROM customers GROUP BY emailaddress HAVING COUNT(emailaddress) > … Continue reading

Posted in Databases | Tagged , | Leave a comment

Chocs To Go is here!

The goal for students on the intermediate PHP and MySQL course that I’m running for IWA/HWG is to create a working shopping cart. The course starts in only three days, and I decided I’d better walk the walk and prove … Continue reading

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