HTN: Hen's Teeth Network Hen’s Teeth Network Blog

Tools of the Trade III: PHP and MySQL

Filed under: Web Development — Tags: , — Scott Youmans on April 16, 2009

Welcome back to part three of our series, Tools of the Trade. Whether you’ve had a web page for years or are just now considering hanging your online shingle, the tools of the trade — and their acronyms — can be confusing. HTML, CSS, JavaScript, AJAX, PHP and MySQL are some of the technologies we use every day to build successful websites for our clients. Last time, we talked about how JavaScript and AJAX allow for interactivity on otherwise static web pages. Today, we’ll learn what PHP and MySQL have to offer.

Web Application Layer CakeMost modern websites are complex applications, combining a user level presentation, a middle layer of programming logic and a back-end layer of data storage and retrieval. For example, when visiting a blog site, the stories that are displayed are the result of a database query to retrieve the most recent stories; some logic to discern which part of the stories to display, such as title, date, summary and a link to the full story; and then the processing of the HTML, CSS and JavaScript that a user sees.

So far, in talking about HTML, CSS, and JavaScript, we’ve been focusing on the first or presentation layer in this “cake” if you will. PHP and MySQL provide the remaining two layers.

Your site’s web server is responsible for delivering HTML, CSS and JavaScript to the web browser, which in turn is responsible for displaying it to your customers. Your web browser doesn’t know how to access data in a database, nor does it have the power to handle the decisions and data structures required by complex applications. Enter PHP. Think of it as the glue between your web server and the database.

PHP is a scripting / programming language for websites. PHP code can be used alongside HTML and JavaScript commands within a web page, or it can exist in a series of files that are assembled to produce a more complex web application. Since neither the web browser nor the web server knows how to interpret PHP code, the web server runs a PHP program to process the file first, and then sends the resulting HTML/etc. on to the web browser. For example, let’s say you go to a website and it asks you to login. The HTML part of the page knows how to display a form and have you submit the form. The PHP portion of the page takes your username and password from the form and asks a database for a record that matches your information. If the record exists, then PHP can build a page with information for logged-in users; if the record does not exist, then PHP builds a page that asks you to retry entering your username and password.

With the tools I’ve discussed in this series – HTML, JavaScript, PHP and MySQL – a website can transform from a flat brochure to an interactive destination, making it easier for your customers to find what they’re looking for and feel engaged with your business. We hope that this series has given you an introduction to the different technologies that make up the web and perhaps some comfort in discussing them with your web solutions provider.

MySQL
MySQL.com
dev.mysql.com – formerly mysql.org

PHP
php.net
PHP Tutorial
MySQL & PHP Tutorial

Tags: ,

No Comments »

No comments yet.

RSS feed for comments on this post.

Leave a comment

You must be logged in to post a comment.

Contact Us | Legal
© Copyright 2001-2009 Hen's Teeth Network, Inc. All Rights Reserved.