php retrieve specific data onclick from database in a list format



PHP Snippet 1:

<?php include("../conn.php");
$query = "select * from semi_synthetic";
$result = mysqli_query($conn, $query);
?>

PHP Snippet 2:

<?php include("../conn.php");
$query = "select * from semi_synthetic";
?>

PHP Snippet 3:

<?php
//Check If Id Isset.

if (isset($_GET["CHIHBT_ID"]))

    //Display Id On A Webpage.
    echo "<p>Calculated Properties of : " . $_GET["CHIHBT_ID"] . "</p>";

$result = mysqli_query($conn, $query);

?>

PHP Snippet 4:

<?php
//Check If Id Isset.

if (isset($_GET["CHIHBT_ID"])) {
    $query .= ' WHERE CHIHBT_ID = ' . $_GET["CHIHBT_ID"]; // add selected id in query

    //Display Id On A Webpage.
    echo "<p>Calculated Properties of : " . $_GET["CHIHBT_ID"] . "</p>";
}


$result = mysqli_query($conn, $query); // run query

?>