1. Home
  2. Computing & Technology
  3. PHP / MySQL

Simple Address Book

By Angela Bradley, About.com

2 of 6

Connect to the Database

<html>
<head>
<title>Address Book</title>
</head>
<body>

<?php
// Connects to your Database
mysql_connect("your.hostaddress.com", "username", "password") or die(mysql_error());
mysql_select_db("address") or die(mysql_error());

Before we can do anything, we need to connect to the database. I have also included an HTML title for our address book. Be sure to replace your host address, username, and password with the appropriate values for your server.

Index: Simple Address Book

  1. The Database
  2. Connect to the Database
  3. Add A Contact
  4. Updating Data
  5. Removing Data
  6. The Address Book

2 of 6

Explore PHP / MySQL

More from About.com

  1. Home
  2. Computing & Technology
  3. PHP / MySQL
  4. Step By Steps
  5. PHP Address Book - Online Address Book - Web Address Book

©2008 About.com, a part of The New York Times Company.

All rights reserved.