searching for the title might give you the right book, but it is possible to get more than one result. You should have an index that is unique for each book. If you don't have one, you can do this by doing:
$sql="Alter book_table_name add book_id int not null auto_increment";
then you can search or your book:
$sql="select * from book_table_name where book_id=164"; // obviously the number would be whatever the book you are looking for
then, in your form, you can prepopulate the values of your form with the values you pull with the sql above. like:
<input type="text" name="title" value="$title">
THEN... when you hit submit, you need to UPDATE not INSERT for your sql:
$sql="UPDATE book_table_name set title=$title, author=$author where book_id=$book_id";
in order for your action page to know if you are inserting or updating, you could use a hidden form field then on the action page, do:
if ($action=="insert") {
do the new code
} else {
do the old INSERT code
}
hope that all helps!
craig