Archive for December, 2005
I thought I'd do a few small tutorials on data validation. Pretty much all websites now require some sort of user input, be it in the form of a newsletter or user registration, or a shopping cart. Its important that this data that is inputted is validated, else you'll find the wrong sort of data is inputted - either due to a malicious user, or a stupid one!
A lot of people get into PHP as its rather easy to code, but they overlook the most simple of input validation routines to ensure that the data coming from the end user matches what they expect. The golden rule of writing a PHP application is to never trust the user input, whether its come from a form via POST, the URL via GET or even a cookie.
Continue Reading December 21st, 2005
At work recently, I had to grab the sum of totals from multiple rows meeting certain conditions in a mysql table. Rather than get each total and add them in PHP in a loop, I decided to get MySQL to do all the legwork for me:
SELECT sum(amount)
FROM table
WHERE id = '$id'
AND condition = '1'
GROUP BY id;
That should return you a summation of the amount columns for all rows matched in the the WHERE statemtents.
December 21st, 2005
From my search stats, its quite clear that a lot of people are struggling with installing the Oracle XE rpm. As a result, I've uploaded the rpm that I used for my installation on Fedora Core 4. You can download this directly at http://www.jellyandcustard.com/downloads/libaio-0.3.104-2.i386.rpm or from the command line by executing this just before installing Oracle XE:
rpm -ivh http://www.jellyandcustard.com/downloads/libaio-0.3.104-2.i386.rpm
Happy installing!
Continue Reading December 10th, 2005
Finally, it appears a beta leak has appeared of Google Earth for Mac OS X. Macs were originally left out of the software release, with google saying:
At this time, Google Earth supports Windows only; however, we hope to support Mac and Linux OS soon. In the meantime, although it might be slower, some Mac users have had success running Google Earth with a PC emulator.
Well here we go. You can download the beta of this software here
December 10th, 2005