<?php // Connects to your Database mysql_connect("your.hostaddress.com", "username", "password") or die(mysql_error()); mysql_select_db("Database_Name") or die(mysql_error()); ?>
// Collects data from "friends" table $data = mysql_query("SELECT * FROM friends") or die(mysql_error()); // puts the "friends" info into the $info array $info = mysql_fetch_array( $data ); // Print out the contents of the entry Print "<b>Name:</b> ".$info['name'] . " "; Print "<b>Pet:</b> ".$info['pet'] . " <br>";