1st July 2010

Thoughts on the Flash vs. HTML5 battle

Flash vs AppleIts been way too long since  I posted, family life and work had taken over but I am back at the helm, and parts 3, 4 and 5 of the PDO tutorial are almost complete! I also have some new MooTools widgets ready to share, including an animated timeline and some fun galleries…..

What this break has proven is how much can change in 6 months sine my last post.  Microsoft’s IE9 is looking like a serious contender for the fastest browser again (the horribly buggy) Google Chrome, iPhone’s now have to be held a certain way(!) and there has been a…

12th January 2010

Testing websites in Internet Explorer 6, 7 and 8

Traditionally we have kept numerous computer platforms to hand with various versions of different browsers to test websites during creation. However, Internet Explorer offers a bit of a headache as sites can vary differ between each version and you can’t easily install more than one version on a single machine.

Luckily, there we have stumbled across a tool that lets you see your site in IE6, 7 and 8 (and 5.5 as well if you are really interested!) called IETester that does just that! Check it out.

Life just got a little easier……

10th January 2010

Working with PDO in PHP and MySQL – Part 2

In Part 1 we looked at how connecting to a MySQL database with PDO differed to connecting to one traditionally in PHP. In Part 2 we are going to look at performing a simple query.

Our sample database

Ok, our test database now has a table to work with, liverpoolplayers, and some data. The structure of the table is:

id (Int)
firstname (Varchar(50))
lastname (Varchar(50))
shirtnumber (Int)
birthday(date)

Nothing too taxing here, the data looks something like this:

id firstname lastname shirtnumber birthday
1 Pepe Reina 25 1982-08-31
2 Jamie Carragher 23 1978-01-28

and so on….

Selecting the data in PHP

To begin with, lets select all the players in name order, surname followed by firstname. Our SQL statement would look something like this:

SELECT * FROM liverpoolplayers…
1st January 2010

Working with PDO in PHP and MySQL – Part 1

Introduction

PDO (PHP Data Objects) in PHP5 works as a database abstraction layer with many advantages for developers. Most importantly for me, it offers the use of stored procedures for tackling SQL injection (see here for some examples of SQL injection if you don’t know what we are talking about), however it doesn’t stop there.

PDO allows you to use the same syntax for any database, which makes using multiple databases or migrating from one database to another easy with just a few simple changes to your code.

Throughout these examples I will be using my database of choice, MySQL, and referring to the…

1st December 2009

Working with PDO in PHP and MySQL

Contrary to what you see on this site I am a big fan of ASP.NET. Microsoft, despite their flaws, have produced an excellent development environment. When working in PHP and MySQL there is plenty of times I pine for the excellent Enterprise Manager in MSSQL or the user interface in Visual Studio.

However, one thing I missed the most was the use of Stored Procedures in MySQL. There are many advantages to using Stored Procedures, the biggest of which is combating SQL injection.

The solution: PDO – PHP Data Objects

Over the next few days I am going to be doing a small…

24th November 2009

Tutorial: Creating a simple MooTools Class

One of the biggest advantages of MooTools is it’s extendability. Almost everything we create for MooTools is turned into class for later use as it makes new code easier to write and manage as well as helping collate a library of useful functions.

We are going to show you how to create a simple class in MooTools. If your starting from scratch I heartily recommend David Walsh’s class template, it covers just about everything you need.

What are we going to make a class out of?

As always, its best to learn by example. We are going to create a class out of…

20th November 2009

Tutorial: Creating an animated rollover menu in Mootools with sprites

One of the things I miss most from my days in Flash is the ability to create really effective menus with simple rollover effects. However, Mootools offers almost the same flexibility whilst being W3C friendly to boot.

Try Menu

What are we going to create?

In this tutorial we are going to create a simple menu with an animated effect when you roll over it. Head over to the demo (or click the shiny button) to see it in action.

Using Sprites

We are going to use a sprite to achieve our effect.

Look at the image below:

spriteanimation

A sprite, for those who can’t remember programming in 2D on…

17th November 2009

Working with dates in PHP and MySQL

Anyone who has worked with PHP and MySQL will have had to deal with dates at some point. However, we often see people adding or retrieving dates the hard way into PHP.

Getting a date from MySQL into PHP the easy way

To get a date out of MySQL the easy way, you can do the following in PHP:

$sqlresult = mysql_query("Select UNIX_TIMESTAMP(logindate) as unix_logindate FROM tbl_users");

$currentrecord = mysql_fetch_array($sqlresult);

echo date('d/m/Y',$currentrecord['unix_logindate']);

As you can see we can treat the field ‘unix_logindate’ as a PHP style timestamp directly from MySQL! This is done by converting a date field, in this case logindate, into a…

10th November 2009

Introducing Mootify – Mootools Notifications

We recently had the need to show users in a CMS an alert without distracting them from the page. I have always been a big fan of the Xbox notifications that pop up at the bottom of the screen when playing a game, so we set about building the same thing in Mootools. The result: Mootify!

Example of Mootify - Mootools Generated Notification

I want to see it!

Try MootifyThere are more demos here, but click this link (or press the shiny button) to see it going.

I want to use it!

Head over to our to our dedicated Mootify page to download it and found out how to use it

10th November 2009

The difficult first post…

Well, everything starts somewhere….

The first post of a blog needs to address two things; why we (and you) are here and what we (and you) are going to be doing. We want this blog to address subjects close to our every day working life on the web, specifically:

  • Mootools
    An exciting Javascript framework that can enrich website interfaces. We want to help introduce developers to it as it isn’t the easiest of frameworks to jump into, develop new widgets and generally have a play around with it!
  • PHP
    Although we work in just about every language, PHP gives everyone a chance to get into server side scripting.…