mysql_connect("localhost", "username", "password");
mysql_select_db("mydatabase");
$result = mysql_query("SELECT * FROM mytable");
while($row = mysql_fetch_array($result)) {
foreach($row as $key=>$value) {
echo "$key = $value
\n";
}
}
mysql_free_result($result);
mysql_close();
?>