|
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 quick dirty way to see the database contents. This row dump is useful for debugging. For example, the field names are visible.
Array ( [person_id] => 1 [title] => Mr [last_name] => Bloggs [first_name] => Fred [date_of_birth] => 1992-12-27 )
Code Listing : personSelect1.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 quick dirty way to see the database contents. This row
dump is useful for debugging. For example, the field names are visible.</p>
<?php
while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
print_r($row); // This prints the $row array contents (useful for debugging)
echo "<br><br>";
}
include "dump.php";
dump_page(basename($_SERVER[SCRIPT_FILENAME])); // Display the code of this page
?>
</body>
</html>
|