|
General Clean Up resets the |
Person Table |
Book Table |
Documentation |
||
|
Note - Create, Drop and Clean Up would be
hidden on a real life system. |
|||||
SELECT * FROM person ORDER BY last_name, first_name
The lines below give a better way to see the database contents.
1 Mr Fred Bloggs 1992-12-27
Code Listing : personSelect2.php |
<?php
require "../MySQL_Login.php"; // Contains host, username, password, and database
$link = mysql_connect($host, $user, $password) or die(mysql_error());
mysql_select_db ($database) or die(mysql_error());
$sql = "SELECT * FROM person ORDER BY last_name, first_name";
$result = mysql_query($sql, $link) or die(mysql_error());
mysql_close($link);
?>
<html>
<head>
<title>SELECT * FROM person;</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
include "nav.php";
echo"<font size=\"+2\"><b><pre>$sql</pre></b></font>";
?>
<p>The lines below give a better way to see the database contents.</p>
<?php
while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
echo $row['person_id'] . " ";
echo $row['title'] . " ";
echo $row['first_name'] . " ";
echo $row['last_name'] . " ";
echo $row['date_of_birth'] . "<br>";
}
include "dump.php";
dump_page(basename($_SERVER[SCRIPT_FILENAME])); // Display the code of this page
?>
</body>
</html>
|