$sql="INSERT INTO tb_rent VALUE(CURDATE())";
$sqlquery=mysql_db_query($dbname,$sql);
$sql = "INSERT INTO tb_rent(id_user,name,id_book,name_book,number,number_date,date_rent,date_send,rent1,total) values('$id_user','$name','$id_book','$name_book','$number','$number_date','$date_rent','$date_send','$rent1','$total')";
$sqlquery=mysql_db_query($dbname,$sql);
$sql1="select number from tb_book where id_book='$id_book'";
$sqlquery=mysql_db_query($dbname,$sql1);
$i=0;
while($i<$num_rows)
{
$result=mysql_fetch_array($dbquery);
$num_book=$result[number];
$rents=$result[rent1];
}
$num_book=$num_book-$number;
$sql_up="update tb_book set number='$number_book' where id_book='$id_book'";
$sqlquery=mysql_db_query($dbname,$sql_up);
$sql1="select total from tb_rent where id_user='$id_user'";
$sqlquery=mysql_db_query($dbname,$sql1);
$i=0;
while($i<$num_rows)
{
$result=mysql_fetch_array($dbquery);
$num_total=$result[total];
}
$total=$rent1++;