|
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
|
1 Mr Fred Bloggs 1992-12-27 |
|
3 Mr John Doe 1982-05-09 |
|
2 Ms Mary Jane 1991-11-24 |
Code Listing : personSelect4.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>";
?>
<table border="1" cellspacing="0" cellpadding="4">
<?php
while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
echo "<tr><td>\n";
echo $row['person_id'] . "<br>\n";
echo $row['title'] . " " .
$row['first_name'] . " " .
$row['last_name'] . "<br>\n";
echo $row['date_of_birth'] . "\n";
echo "</td></tr>\n";
}
?>
</table>
<?php
include "dump.php";
dump_page(basename($_SERVER[SCRIPT_FILENAME])); // Display the code of this page
?>
</body>
</html>
|