I'm trying to learn PHP and I've started with a simple CRUD project. I've basically downloaded some source code and I'm just trying to work through it. When I got to the delete part of the CRUD project I came across this code:
include 'connect.php';
$id = $_GET['id']; // What does this line do?
$table = 'book';
$query = "DELETE FROM $table WHERE id_book=$id";
$result = mysqli_query($connect, $query) or die(mysqli_error($connect));
header('location: index.php');
I'm really confused by this line:
$id = $_GET['id'];
When I did some searching on Google the only thing I found was a short description from some similar code that said 'getting id from URL'. This made no sense to me. What does this line actually doe and what gets stored in the $id variable?