PHP MySQL
Create & Test MySQL Database

Build a MySQL Database on Your PC then Export it to Your Website


The scripts in this tutorial were Last Tested on : August 8, 2014.

At that time PHP 5 was the current version. Today's version is PHP 7 and we have not retested. Information for installing a localhost was based on Windows 7. Might still work. Might Not. I'm old, tired, lazy and have traded Windows for Linux. Nuff said?


Introduction

The combination of PHP and MYSQL, when used together can create some pretty impressive results for dynamic interactive websites.

Unfortunately, PHP/MySQL has always been a confusing subject for beginner website authors and even some with experience.

It has always been a hassle to create your database on your web host's server and then use scripts to add data or records to to the database and provide access for your website users.

This tutorial will show you A BETTER WAY.

I'll show you how, step by step,to build your database and your scripts right on your PC and then Export everything to your web hosting account after you've worked out all the bugs.

I'll introduce you to 2 tools that will make the experience easier and successful for almost everyone that tries.

 

The Lessons

The lessons provided in this tutorial will be short and simple. You'll learn to create and manipulate a simple database of names and birthdates.

  1. Connecting to the MySQL Server
  2. Creating the Database
  3. Creating a Table
  4. Adding a Record
  5. Displaying Records
  6. Updating a Record
  7. Deleting a Record
  8. Altering Tables
  9. Exporting to Your Website

 

Building Your Database on Your PC

In order to build your database on your PC and later Export it to your website requires setting up a localhost server on your PC and finding an HTML editor that will sync up with the server.

If you use Windows, the process of setting up and running a localhost so that you can test and edit scripts and build databases is very easy.

I recommend the IndigoAMPP web server and the HTMLPad 2014 HTML editor.

I recently installed IndigoAMPP for Windows on my Windows 7 system and it ran on the first try after installation. Setting up HTMLPad 2014 to work with it is also an easy process.

Note=> Windows Vista User: You will need to turn off the Windows User Account security feature when installing and using both the IndigoAMPP server and the PostCast mailserver (if using to test email scripts).
(Windows Control Panel - User Account) Just uncheck the box when installing and using these tools.

I created a little tutorial that shows the whole process including how to start the server after you install it.
Go to Tutorial (DO THIS BEFORE YOU START THIS TUTORIAL)
Note: The server is FREE and you can try the HTML editor for 30 sessions or 30 days free. If you can't learn to build your database in that amount of time, don't buy the editor. NO RISK!!

Using Other Editors

You can complete this mini course with an HTML editor other than HTMLPad 2014.

The procedure for looking at your web pages and running scripts will be much more involved.

You will download the scripts to the htdocs folder of the indigoAMPP server.

To run the scripts, you will start the IndigoAMPP server, open your browser and enter the url of the script manually as:
http://localhost/nameofscript.php

When you get tired of doing that, download a free trial of HTMLPad 2014

MySQL Tutorial

To extend your knowledge of MySQL study the Docs and Tutorials at the official MySQL website. MYSQL.com
The best information on using PHP with MySQL will be found at PHP.net