I have recently been using a jQuery plugin called imgAreaSelect, which allows you to crop images. I wanted to use it with my PHP site so that thumbnails could be cropped and created.

GD Library is a PHP library that allows manipulation of images, in particular it can create new images.  It may need to be installed on some servers, but I found it already installed on my host and on MAMP (my local server). Combining this with imgAreaSelect read more

Inserting before and swapping rows in mySQL

Posted August 25th, 2009. Filed under PHP

The logic behind inserting a record is to increment every record in front of it (that is, to increment the field that you order the table by), so that a space is given.  Swapping records is a bit more tricky, even though you are simply exchanging data between two rows, at some point both pieces of data will be the same (between updating the first and second record).  So doing this on a primary key field is not an option.  I can also imagine it’s best to avoid changing data whatsoever on the primary key field, as it’s use is for reference and not really for order, problems read more