To make it even clearer, the following piece of code display data in a very simple table where I am unable to put any link besides the table whereby users can navigate to the other pages. This simple table simply restricts my navigation. Obviously i can use the back <- button of the browser, but i want to give my page a consistent look. So, just like other pages i wanna put some links[i.e: home, insert data, delete data..etc] on the page where the retrived data will be displayed.
Code:
Code: Select all
<?php
<html>
<head><title>Show Book List in Library Stock</title></head>
<body>
<h3>List Of Available Books</h1>
<?php
$db = mysql_connect("localhost", "root");
mysql_select_db("library",$db);
$result = mysql_query("SELECT * FROM book",$db);
echo "<table border=2>\n";
echo "<tr><td>call_no</td><td>title</td><td>author1</td><td>author2</td><td>publisher</td><td>isbn</td><td>price</td><td>no_of_page</td><td>edition</td><td>category</td></tr>\n";
while ($myrow = mysql_fetch_row($result)) {
printf("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>\n",
$myrow[0], $myrow[1], $myrow[2],$myrow[3],$myrow[4],$myrow[5], $myrow[6],$myrow[7],$myrow[8],$myrow[9]);
}
echo "</table>\n";
?>
</body>
</html>
?>