$add_sql = "UPDATE guestbook (tot_star,tot_comment) VALUES ('$tot_star','$tot_comment') WHERE book_id=$book_id";
mysql_query($add_sql);
I tried with that, how to write it to the database
The fastest way to get an answer to this question, Naga, would be to go look at the MySQL manual and read the section called "UPDATE Syntax." http://www.mysql.com/