PHP develops simple book borrowing system complete book return function implementation code

Introduce the database file config.php

Create a complete return code file huanshu.php

alert('您还没有登陆');window.location='landing.php'"; exit(); } $book_id=$_GET["book_id"]; //构建sql语句还书 //在lend表中删除该借书记录 $returnsql="DELETE FROM lend where book_id='$book_id' and user_id=".$_SESSION['id']; mysqli_query($link,$returnsql) or die ("删除借书记录失败:".mysqli_errno($link)); //在book表中增加一本现存书数量 $booksql="UPDATE yx_books SET leave_number=leave_number+1 where id='$book_id'"; mysqli_query($link,$booksql) or die ("增加剩余书数量失败:".mysqli_error($link)); echo ""; ?>


Continuing Learning
||
alert('您还没有登陆');window.location='landing.php'"; exit(); } $book_id=$_GET["book_id"]; //构建sql语句还书 //在lend表中删除该借书记录 $returnsql="DELETE FROM lend where book_id='$book_id' and user_id=".$_SESSION['id']; mysqli_query($link,$returnsql) or die ("删除借书记录失败:".mysqli_errno($link)); //在book表中增加一本现存书数量 $booksql="UPDATE yx_books SET leave_number=leave_number+1 where id='$book_id'"; mysqli_query($link,$booksql) or die ("增加剩余书数量失败:".mysqli_error($link)); //echo ""; ?>
submit Reset Code
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!