Tech Time: PHP and MySQL

Content

Online Resources

Downloads

The Trials and Tribulations of a Web Developer

As your knowledge of PHP continues to expand and you begin writing more complex scripts, managing data, specifically large amounts of data with complex relationships to other data, becomes incredibly difficult using just text files for storage. Because there are no methods for accessing specific 'records' in custom storage formats, a programmer will have to spend a substantial amount of time writing algorithms for accessing them. Fortunately however, through the use of a database system such as MySQL, this process, which is often incredibly tedious, becomes entirely unnecessary.

In the first portion of the session, we will create an HTML form which accepts input from a user, and then writes the inputted data to a text file via a PHP script. With this as a foundation, we will then briefly discuss the difficulties involved with writing a script to access this information for later use.

In the second portion of this session, we will introduce MySQL, discuss the advantages it has over storing data in text files, and then demonstrate how to modify the form created in the first section to write data to a database.

HTML Experience:
Though PHP and MySQL can be used independently of HTML, this session will focus on using them in conjunction. For example, we will write an HTML form to accept input from a user. Then, we will use PHP and MySQL to store this data.
Basic PHP Skills:
A person participating in this session should have a fundamental understanding of programming and PHP.

Technical Requirements:

In order to complete this session, participants need FTP access to a web server with PHP 4.x.x or greater installed. This will allow for testing any of the scripts that are created during the hands on portion of this session.

Fortunately, Pegasus provides everything participants will need for the hands on portion of this session. For information about accessing your Pegasus account, please visit the Help Desk website.

At the current time, we do not have the ability to offer Tech Time participants with their own practice MySQL database. As a result, participants will be unable to test any scripts that use MySQL. If you have access to your own web server and you have MySQL and phpMyAdmin installed, you are more than welcome to follow along as we present the material to you.

For those who administer their own servers:

Resources Used to Develop this Presentation:

As with most projects involving PHP and MySQL, the vast amount of information and resources located at PHP.net and mysql.com were incredibly helpful.