Archive for March, 2008

Using Foreign Keys in MySQL

March 28th, 2008 No comments

On the article at php|architect, Ligaya Turmelle explains you how to handle Foreign Keys in MySQL so they can serve your whims.

No, foreign keys aren’t from Brazil or Italy or even the US. Though they can be a bit strange to those who do not understand them, have no fear. We are here to teach you how to talk to them so they can serve your whims. So what are foreign keys exactly?

Not to put too fine a point on it, they are what make a relational database “relational.” They are the links between tables that keeps everything connected. They are what allows you to put a customer in one table and their order in another and the products they are ordering in a third table so the database has minimal data redundancies.

She continues with the article with a good example. Read it

Categories: mysql, Tips Tags:

PHP 5.3 upto 30% performance boost

March 27th, 2008 No comments

As Johannes Schluter mentions, the results of some benchmarking have been posted concerning the performance of PHP 5.3 versus the current 5.2 series:

Dmitry posted results of performance test comparing PHP 5.2 and 5.3 to internals which are impressive numbers.

The improvements were measured based on several popular pieces of software like Drupal, typo3 and WordPress. The overall performance gian was around thirty percent across the board.

Categories: PHP Tags:

Building File Uploaders :: Object Method

March 25th, 2008 No comments

On DevShed there’s a new tutorial showing how to build file upload functionality into your scripts.

If you’re a PHP developer who has built a certain number of web applications, then it’s quite probable that you’ve already worked with HTTP file uploads. [...] First I’m going to teach you how to handle file uploads using a procedural approach, and then, with the topic well underway, by way of the object-oriented paradigm.

The introduce the beginners out there to the $_FILES array (a superglobal) that contains the details about the file(s) that have been submitted. Next comes the construction of a simple form and how to handle the submission on the PHP side.

Categories: PHP, Tips Tags: