Using Foreign Keys in MySQL

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

PHP 5.3 upto 30% performance boost

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.

Building File Uploaders :: Object Method

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.

Back to PHP after 2 years on Rails

In this post Sivers writes I spent two years trying to make Rails do something it wasn’t meant to do, then realized my old abandoned language (PHP, in my case) would do just fine if approached with my new Rails-gained wisdom.

“Is there anything Rails can do, that PHP CAN’T do?”

The answer is no.

I threw away 2 years of Rails code, and opened a new empty Subversion respository.

Then in a mere TWO MONTHS, by myself, not even telling anyone I was doing this, using nothing but vi, and no frameworks, I rewrote CD Baby from scratch in PHP. Done! Launched! And it works amazingly well.

It’s the most beautiful PHP I’ve ever written, all wonderfully MVC and DRY, and and I owe it all to Rails.

Read the original post by Derek Sivers

PHP Meetup Required

Well long back once, I tried for a php meetup, some where in technopark trivandrum, and failed miserably. Well this time I am not going to announce anything like that. Those of you who see this, give a good boostup, and send feedbacks.

Once we have a handful of interested people, we will think of the venue as well as the date. Though it would be better to have either on friday or saturday evening, as that would affect the company which we are working for least.

MySQL Backups and a lot more

A couple of years back, I had asked several people through groups, and posts the possibility of backing up a MySQL database programatically, from client side applications which could connect to remote servers running MySQL. There was a lot of suggestions,

* php script on server to take backup on server
* application code to select the data and do a round trip
* mysqldump from client machine with the server parameters

And finally from all those valuable suggestions from all the helpful people, I derived my own hybrid method which I would summarize in a few words. This is a method, which I have adopted for web applications in php as well as custom single machine applications in Visual Basic. How this can be termed as hybrid can be known by going into the structure, though it seems to be a bit complicated, it would serve the purpose and be worth the headache.

Continue reading “MySQL Backups and a lot more”

# PHP Programming Innovation Award

The PHP Programming Innovation Award is to provide recognition to developers who make outstanding contributions to the PHP community.

The award aims to honor developers who share components in the form of PHP classes of objects that provide innovative features or solve problems with approaches that provide additional value to the PHP applications of other developers.

The main goal of this award is to encourage developers to contribute PHP components that provide innovative features, instead of just replicating the features already provided by previously contributed components.

At the same time it is expected or hoped that the recognition and prizes, which can be earned by award nominees and winners, will motivate more capable developers, who otherwise would not participate, to make contributions.

The PHP community has grown naturally without a marketing force persuading developers to adopt it, unlike other languages that are backed by big companies with large budgets to invest in huge marketing campaigns.

This award also has an implicit goal to inspire other sites or companies to promote PHP and its community by means of other initiatives, hopefully different from this one, that focus on motivating and providing recognition to individuals or groups who make outstanding contributions to the PHP community and foster the continuation of its growth.

More Information

NANOWEB, a web server written entirely in PHP

NANOWEB is a http server written entirely in PHP 4.3. It does not need apache or any other server software to work, just the php4 binary.

As commented on the online manual, the installation was really easy with the command line tool handling the task. Though the configuration was a bit tough for me. Not that the configuration syntax, but finding the files was a bit confusing. Though only later on I came to know about the nanoweb-nanoconfig, an ubunty fiesty package which helps configuring nanoweb using a web interface.

Though the feature list is long, the full power can be achieved only in an os where php can provide the POSIX fork() call. I could find this enough for demonstration purposes, but for real heavy work, I still depend on a different application server.

The Power of Google Gears (Part 1)

by Jack Herrington
Web application development is the perfect 95 percent solution. It’s very easy to develop a simple HTML frontend to something like PHP or Rails, to deliver data to and from a MySQL database. You can even give it a more desktop feel by using Ajax tools. But that last five percent, the ability for desktop applications to work offline, was missing from the web world until the release of Google Gears.

Read the rest of the article