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

Simple Address Book

By , About.com Guide

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.

Explore PHP / MySQL
About.com Special Features

The Best Web Trends of the Decade

A look back at the best innovations, ideas and technologies over the last 10 years, More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

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

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

All rights reserved.