Currently Browsing: Home » 2010 » December

Archive for December, 2010

Streamlining MySQL Insert Queries

PHP and MySQL have often been known as two peas in a pod. Unfortunately, when you use PHP to insert information into a MySQL database, you often have to write large queries that take up much of your time. Not only that, but you also have to clean user input. This quick tip aims to streamline your efficiency by writing a simple function to do this job for you.

Write helper functions

Helper functions

Before we start working on the main program, we first need to create two helper functions which will be used later on:

Read the rest of this entry »

How Can This Image Detect My Browser!?

Take a look at this image in Firefox or Opera. Now view it again in any other browser. Notice a difference?

In case you don’t have multiple browsers, here’s a screenshot of a side-by-side comparison of Firefox and Safari:
comparison in ff/safari

So how is it possible that this PNG file can magically detect what browser you’re using? Read on to find out.

Read the rest of this entry »