1. Computing

Simple Address Book

By

1 of 6

The Database
Simple Address Book
This tutorial will walk you through creating a simple address book using PHP and MySQL.

Before we can begin we need to decide what fields we wish to include in our address book. For this demonstration we will use Name, E-mail and Phone number, although you can modify it to included more options if you like.

To create this database we need to execute this code:

 

CREATE TABLE address (id INT(4) NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(30), phone VARCHAR(30), email VARCHAR(30));
INSERT INTO address (name, phone, email) VALUES ( "Alexa", "430-555-2252", "sunshine@fakeaddress.com"), ( "Devie", "658-555-5985", "potato@monkey.us" )

This creates our database fields, and puts in a couple of temporary entries for us to work with. We are creating four fields. The first is a self incrementing number, then name, phone and email. We will use the number as a unique ID for each entry when editing or deleting.

Related Video
Link a Website to an Email Address in HTML
  1. About.com
  2. Computing
  3. PHP / MySQL
  4. Step By Steps
  5. How to create a simple address book using PHP

©2014 About.com. All rights reserved.