PHP MySQL
Interactive Website Design

Creating the Database

When you create a database on your web hosting account, you will create your database using the MySQL Database management tool on your web host's control panel.

I don't know of any web hosts that will allow you to create databases from PHP scripts.

If you are going to test the scripts on the IndigoAMPP server with HTMLPad, we'll run through the process of creating your database from the PHPMyAdmin panel on IndigoAMPP.

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 2010 HTML editor.

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

I created a little tutorial that shows the whole process including how to start the server after you install it. Go to 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!!

IndigoAMPP Users

Start the IndigoAMPP server and open HTMLPad 2010.

There are 2 ways to access PHPMyAdmin

1...With HTMLPad 2010:
Click File - Open
Navigate to C:\indigoampp\apache-2.2.11\htdocs\phpmyadmin\scripts

Find the script named signon.php and load it into the editor window

Click Preview

IndigoAMPP #1

Since IndigoAMPP is configured to accept the user named root without a password on localhost, enter those values as shown and click Submit Query.

If the server is running and you've set Preview -Mappings for the htdocs folder (HTMLPad 2010 users), you'll go right into the PHPMyAdmin panel.

2...With your browser:
Make sure the IndigoAMPP server is turned on
In the top of your browser type: http://localhost/
Hit Enter
In the Index of files find: phpMyAdmin/ and click.

IndigoAMPP #2

Note: If you use the second method, you can leave the PHPMYAdmin panel open and view your changes as you run through the lessons. You will make a change, then Refresh the browser.

To Create the Database

To create the database named newdb that we'll use in this tutorial, find the box shown here:

IndigoAMPP #3

Enter: newdb and click Create

That's it. You are ready to start running scripts that add Tables and Insert data into your database.

Note: You don't need to open and close the PHPMyAdmin panel.
If you leave it open and don't see changes like tables added, refresh the browser and your changes will show.


Now let's run a script to add a table to the new database.

Proceed to: Create a Table



Download the Scripts

The Birthdays Database management files can be downloaded in a zip file.

If using IndigoAMPP download to c:\indigoampp\apache-2.2.11\htdocs.

Extract there and you'll have a birthdays folder inside your htdocs folder. Run the scripts from there.

The package contains an integrated db management system, with a simple interface.

This Instruction file is included in the download.
Download birthdays_db.zip

MySQL Tutorial

To extend your knowledge of MySQL study the Docs and Tutorials at the official MySQL website. MYSQL.com