Here are some code blocks to navigate the ID value for updating the mysql query. But We can use the PHP session also with maximum performance and hihg reusable compatibility.
source web site: http://www.picnicpt-h.schools.nsw.edu.au/Faculty_Webs/TAS/IT/year12/InfoSysDB/2_3.htm this database is refer with Library Management System.