Hi Folks,
I have the following script that browses a database of books and
presents the titles and other attributes in a nice table. Each title is written into the first column of the table as a "href" and I have attached an example table.
The attachted example table contains only a single title (sorry about the length, but I think it's easier to answer my question if you can see what the table looks like rather than me having to describe it).
Anyway what I want to do is, when the user clicks on a title,
the "details.php" script (line 35), or alternatively a function, opens a html form that shows all the attributes of the book and allows the user to edit/delete or update the record in the database. (the table shows only a subset of the available attributes).
My question is: can someone explain the best way to call the second script (or function) and pass the booktitle and other attributes as arguments to it?
thanks,
Denis
=======
php script
<html>
<head>
<title>Browse Books</title>
</head>
<body>
<h1><FONT SIZE="2">Book Titles<BR>
<?php $Date = date("l F j, Y"); echo $Date ?>
</h1>
<?php
include_once "./ez_sql.php";
#
$results=$db->get_results(
"SELECT b.booktitle, a.lastname, a.firstname,
b.bookpublisher, b.datepublished, b.bookshelfid
FROM books b, authors a, haswritten h
WHERE b.bookid=h.hw_bookid
AND a.authorid=h.hw_authorid
ORDER BY b.booktitle"
);
#
echo "<table bgcolor=eeeeee BORDER=1>
<th><FONT SIZE=2 COLOR=000090>Title
<th><FONT SIZE=2 COLOR=000090>Author's<BR>Surname
<th><FONT SIZE=2 COLOR=000090>Author's<BR>Firstname
<th><FONT SIZE=2 COLOR=000090>Publisher
<th><FONT SIZE=2 COLOR=000090>Date<BR>Published
<th><FONT SIZE=2 COLOR=000090>Shelf<BR>Number
\n";
foreach ($results as $book)
{
echo "<tr>","\n";
echo "<td>","<FONT SIZE=2>","<a href=details.php>" . $book->booktitle . "</a>","\n";
echo "<td>","<FONT SIZE=2>" . $book->lastname,"\n";
echo "<td>","<FONT SIZE=2>" . $book->firstname,"\n";
echo "<td>","<FONT SIZE=2>" . $book->bookpublisher,"\n";
echo "<td>","<FONT SIZE=2>" . $book->datepublished,"\n";
echo "<td>","<FONT SIZE=2>" . $book->bookshelfid,"\n";
echo "</tr>";
echo "\n";
echo "\n";
}
echo "</table>\n";
?>
</p>
</body>
</html>