I want to display only the selected result on my php page.
This is my php code:
$bookdetsql = "
SELECT b.bookISBN
, b.bookTitle
, b.bookYear
, b.catID
, b.pubID
, p.pubName
, p.location
, c.catDesc
, b.bookPrice
FROM nbc_book b
LEFT
JOIN nbc_category c
ON b.catID = c.catID
LEFT
JOIN nbc_publisher p
ON b.pubID = p.pubID
";
$bookdetrs = mysqli_query($conn, $bookdetsql) or die(mysqli_error($conn));
$bookdetnum = mysqli_num_rows($bookdetrs);
if($bookdetnum >= 1 ){
echo "<div style='margin: 0 0 10px 0; font-weight: bold;'>$bookdetnum record(s) found!</div>";
while ($row = mysqli_fetch_assoc($bookdetrs)) {
echo "<tr>";
echo "<td><center>" . $row['bookTitle']."</a></center></td>";
echo "<td><center>" . $row['bookYear']."</center></td>";
echo "<td><center>" . $row['catDesc']."</center></td>";
echo "<td><center>" . $row['bookPrice']."</center></td>";
echo "<td><center>" . $row['pubName']."</center></td>";
echo "<td><center>" . $row['location']."</center></td>";
echo "</tr>";
}
} else {
echo "<b>Books not found!</b>";
}
In fact, this code shows virtually the entire list of entries. I just want it to display the selected entry that I clicked on the first page of php.
source
share