PHP How can I access the contents of the a href headers I brought from the database

this is my first question consider a library scenario,

$cek_stmt = $pdo->query("SELECT * FROM books_categories");
while ($tur_row=$cek_stmt->fetch(PDO :: FETCH_ASSOC))

echo '<a href="'.$tur_row['catagories'].'"+"html">'.$tur_row['catagories'].'</a>';


I have 2 tables in the database, I introduced the types of books as foreign keys in the books. How can I show the books registered to the genre id on a new page when I click on the link? when I click on one of the categories, how can I pull the data in the relevant category to a new page?