Author Archives: james

mysqldump 5.1.36 unable to successfully dump a MySQL database in UTF-8 character encoding issues

Today I had a character encoding problem when importing some data from a mysqldump from a contractor we had hired to do some work.  Everything about the dump was fine, the database, tables, and fields were all using utf8_unicode_ci utf8 collation, the dump file was encoded in utf8, and the database I was importing to […]

disable firefox native inspect element context menu

With the latest update of Firefox to version 10.0, they included some new developer tools which are similar to what is available via Firebug or WebKit’s developer tools.  About time!  Unfortunately, I still am so used to firebug that will continue using it instead of these new native development tools.  One thing that really grinds […]

php mysql collation change script

There are times when we get stuck with bad collations on our mysql tables and we are overwhelmed by having to change them by hand. Well, I have written a php script which will go through all your tables and fields in a database and update them to the collation which works for you. In […]

MySQL alter table to re-order columns

Sometimes because of my completely anal nature, I want the fields that I’ve already added to a table in MySQL to be in a different order. To do this you can simply alter that table column, without changing any of its properties, then adding “AFTER column_3”. So for instance you had a table like this: […]

CSS3 dual background glow highlight button

I have been working on a new UI at work and decided to go full on with it in HTML5 and CSS3 because its 98% for internal company users who all use a “modern browser” and I don’t have to worry about those pesky IE users. The following code is for a cool looking glow […]

php imagick complex gradient composite image

Manipulating images with imagemagick for php can be difficult, especially when you are trying to create complex images for a web template. Here is a more complex example of how to create sweet dynamic web graphics. This is a version of a header image that I created for a template design. It involves 4 colors, […]

simple but useful php base object for mysql table interaction

I started a project creating an online game which involved lots of objects and tables. Rather than rewrite the same code over and over, I decided to create a base object in which i could simple extend the base object to work with any mySQL table by simply listing all the fields. Here is the […]

php imagick round corner box with dropshadow

In this post I will show you how to create a rounded corner box with a drop shadow. First set your background color, foreground color, and the color of the drop shadow. Once you’ve set up your colors, the script will create two identical imagick objects, one for the background, and one for the foreground. […]

php imagick button with round corners and a bezier curve

This post involves a little more complex example of what imagick can do. I am going to show you how to use the draw object to create an button which has rounded corners and a multi-colored curve accent using the “bezier” function of the ImagickDraw object. First, lets get things set up. We are using […]

php imagick add round corners to a jpg image

One might think this would be an easy task, and it is, unless you want it to look good. Unfortunately, imagick really only performs well when processing images with an alpha channel. I’ve found that PNG format works best. So, to add rounded corners to a jpg image with php’s imagick object, there are a […]