|
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 book ORDER BY book_title
Code Listing : bookUpdate.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 book ORDER BY book_title";
$result = mysql_query($sql, $link) or die(mysql_error());
mysql_close($link);
?>
<html>
<head>
<title>Book Update</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>";
?>
<form name="form1" method="post" action="bookUpdateForm.php">
<table border="1" cellspacing="0" cellpadding="4">
<tr>
<td><h3>Accession Number</h3></td>
<td><h3>Book Title</h3></td>
<td><h3>Author</h3></td>
<td><h3>Publisher</h3></td>
<td><h3>ISBN</h3></td>
</tr>
<?php
while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
echo " <tr>\n";
echo " <td>" . $row['accession_num'] .
"<input name=\"rb_accession_num\" type=\"radio\"
id=\"rb_accession_num\" value=\"" . $row['accession_num'] . "\">
</td>\n";
echo " <td>" . $row['book_title'] . "</td>\n";
echo " <td>" . $row['author'] . "</td>\n";
echo " <td>" . $row['publisher'] . "</td>\n";
echo " <td>" . $row['isbn'] . "</td>\n";
echo " </tr>\n";
}
?>
<tr>
<td colspan="5" align="right">
<input type="submit" name="Submit" value="Submit">
</td>
</tr>
</table>
</form>
<?php
include "dump.php";
dump_page(basename($_SERVER[SCRIPT_FILENAME])); // Display the code of this page
?>
</body>
</html>
|